Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
eb7d19ed
Commit
eb7d19ed
authored
Jan 30, 2012
by
Salvatore Sanfilippo
Browse files
Merge pull request #319 from fawek/lua-error-location
Lua reports line numbers off by one in error messages
parents
824ea017
4d776dba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
eb7d19ed
...
...
@@ -516,9 +516,9 @@ int luaCreateFunction(redisClient *c, lua_State *lua, char *funcname, robj *body
funcdef
=
sdscat
(
funcdef
,
"function "
);
funcdef
=
sdscatlen
(
funcdef
,
funcname
,
42
);
funcdef
=
sdscatlen
(
funcdef
,
"
()
\n
"
,
4
);
funcdef
=
sdscatlen
(
funcdef
,
"()
"
,
3
);
funcdef
=
sdscatlen
(
funcdef
,
body
->
ptr
,
sdslen
(
body
->
ptr
));
funcdef
=
sdscatlen
(
funcdef
,
"
\n
end
\n
"
,
5
);
funcdef
=
sdscatlen
(
funcdef
,
"
end"
,
4
);
if
(
luaL_loadbuffer
(
lua
,
funcdef
,
sdslen
(
funcdef
),
"func definition"
))
{
addReplyErrorFormat
(
c
,
"Error compiling script (new function): %s
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment