diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.207 2013/10/07 14:20:31 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.208 2013/12/16 14:27:17 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -270,7 +270,10 @@ static int pushline (lua_State *L, int firstline) { | |||
270 | l = strlen(b); | 270 | l = strlen(b); |
271 | if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ | 271 | if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ |
272 | b[l-1] = '\0'; /* remove it */ | 272 | b[l-1] = '\0'; /* remove it */ |
273 | lua_pushstring(L, b); /* save line in Lua */ | 273 | if (firstline && b[0] == '=') /* for compatibility with 5.2, ... */ |
274 | lua_pushfstring(L, "return %s", b + 1); /* change '=' to 'return' */ | ||
275 | else | ||
276 | lua_pushstring(L, b); | ||
274 | lua_freeline(L, b); | 277 | lua_freeline(L, b); |
275 | return 1; | 278 | return 1; |
276 | } | 279 | } |