Skip to content

Commit e27f694

Browse files
committed
fix declaration scope
1 parent 8eee71d commit e27f694

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/llocking.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)