diff options
author | Jakub Wieczorek <fawek@fawek.net> | 2012-01-29 14:53:49 +0100 |
---|---|---|
committer | Jakub Wieczorek <fawek@fawek.net> | 2012-01-29 14:53:49 +0100 |
commit | 4d776dba3c706aa20fd7d95dd73bff32dc2148a7 (patch) | |
tree | a5ca60d881e24b896763a59a0e7eebbb4895cda9 /src | |
parent | 6c29410117b100b13764280bb3c58604b769c4fc (diff) | |
download | redis-4d776dba3c706aa20fd7d95dd73bff32dc2148a7.tar.gz |
Lua reports line numbers off by one in error messages
Diffstat (limited to 'src')
-rw-r--r-- | src/scripting.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripting.c b/src/scripting.c index 1503c3c90..255184e7d 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -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,"\nend\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", |