File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,16 @@ function test()
470
470
end
471
471
test ()
472
472
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
+
473
483
-- issue #459
474
484
function test ()
475
485
local a , b = io.popen (" ls" , nil )
Original file line number Diff line number Diff line change @@ -404,10 +404,10 @@ normalreturn:
404
404
return L .GetTop () - top
405
405
406
406
errreturn:
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
411
411
}
412
412
413
413
var fileSeekOptions = []string {"set" , "cur" , "end" }
You can’t perform that action at this time.
0 commit comments