소스 검색

Merge pull request #242 from nuskey8/fix/io-type-name

Fix IO type and mode not working well
Akito Inoue 2 주 전
부모
커밋
cfc730c8f7
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/Lua/IO/LuaFileOpenMode.cs
  2. 1 1
      src/Lua/Standard/IOLibrary.cs

+ 1 - 1
src/Lua/IO/LuaFileOpenMode.cs

@@ -68,7 +68,7 @@ public static class LuaFileOpenModeExtensions
             "w+b" => LuaFileOpenMode.WriteUpdate,
             "a+" => LuaFileOpenMode.AppendUpdate,
             "a+b" => LuaFileOpenMode.AppendUpdate,
-            _ => 0
+            _ => (LuaFileOpenMode)(-1)
         };
     }
 

+ 1 - 1
src/Lua/Standard/IOLibrary.cs

@@ -191,7 +191,7 @@ public sealed class IOLibrary
 
         if (arg0.TryRead<FileHandle>(out var file))
         {
-            return new(context.Return(file.IsOpen ? " file" : "closed file"));
+            return new(context.Return(file.IsOpen ? "file" : "closed file"));
         }
         else
         {