• antirez's avatar
    Scripting: handle trailing comments. · f43c794b
    antirez authored
    This fix, provided by Paul Kulchenko (@pkulchenko), allows the Lua
    scripting engine to evaluate statements with a trailing comment like the
    following one:
    
        EVAL "print() --comment" 0
    
    Lua can't parse the above if the string does not end with a newline, so
    now a final newline is always added automatically. This does not change
    the SHA1 of scripts since the SHA1 is computed on the body we pass to
    EVAL, without the other code we add to register the function.
    
    Close #2951.
    f43c794b
scripting.c 84.5 KB