File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,16 @@ function test()
470470end
471471test ()
472472
473+ -- issue #455
474+ function test ()
475+ local path = " ."
476+ local fd , _ , code = io.open (path , " r" )
477+ assert (fd ~= nil )
478+ local _ , _ , ecode = fd :read (1 )
479+ assert (ecode == 1 )
480+ end
481+ test ()
482+
473483-- issue #459
474484function test ()
475485 local a , b = io.popen (" ls" , nil )
Original file line number Diff line number Diff line change @@ -404,10 +404,10 @@ normalreturn:
404404 return L .GetTop () - top
405405
406406errreturn:
407- L .RaiseError ( err . Error () )
408- // L.Push(LNil )
409- // L.Push(LString(err.Error()))
410- return 2
407+ L .Push ( LNil )
408+ L .Push (LString ( err . Error ()) )
409+ L .Push (LNumber ( 1 )) // C-Lua compatibility: Original Lua pushes errno to the stack
410+ return 3
411411}
412412
413413var fileSeekOptions = []string {"set" , "cur" , "end" }
You can’t perform that action at this time.
0 commit comments