File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -99,21 +99,24 @@ int eli_file_lock(lua_State *L) {
9999 const int argt = lua_type (L , 1 );
100100 int ownsFile = 0 ;
101101 switch (argt ) {
102- case LUA_TUSERDATA :
102+ case LUA_TUSERDATA : {
103103 fh = check_file (L , 1 , "lock" );
104104 break ;
105- case LUA_TSTRING :
105+ }
106+ case LUA_TSTRING : {
106107 const char * path = luaL_checkstring (L , 1 );
107108 fh = fopen (path , "ab" );
108109 if (fh == 0 ) {
109110 return push_error (L , "lock" );
110111 }
111112 ownsFile = 1 ;
112113 break ;
113- default :
114+ }
115+ default : {
114116 luaL_error (L , "lock: Invalid type (%s) string or FILE* expected." , argt );
115117 return 0 ;
116118 }
119+ }
117120 const long start = (long )luaL_optinteger (L , 3 , 0 );
118121 const long len = (long )luaL_optinteger (L , 4 , 0 );
119122 const char * mode = luaL_checkstring (L , 2 );
You can’t perform that action at this time.
0 commit comments