Kaynağa Gözat

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

Fix IO type and mode not working well
Akito Inoue 2 hafta önce
ebeveyn
işleme
cfc730c8f7

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

@@ -68,7 +68,7 @@ public static class LuaFileOpenModeExtensions
             "w+b" => LuaFileOpenMode.WriteUpdate,
             "w+b" => LuaFileOpenMode.WriteUpdate,
             "a+" => LuaFileOpenMode.AppendUpdate,
             "a+" => LuaFileOpenMode.AppendUpdate,
             "a+b" => 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))
         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
         else
         {
         {