diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-29 13:59:35 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-29 13:59:35 -0200 |
commit | aee3f97acb3efd5e020f59ed89c9036c58721850 (patch) | |
tree | 820eb6f9a0e0b3301c99ed7784985b8ae80519db | |
parent | 46968b8ffa232a642cdc2f77cb02c7aa61ab9b89 (diff) | |
download | lua-aee3f97acb3efd5e020f59ed89c9036c58721850.tar.gz lua-aee3f97acb3efd5e020f59ed89c9036c58721850.tar.bz2 lua-aee3f97acb3efd5e020f59ed89c9036c58721850.zip |
put back quotes (") when string in dostring ends with a \n
-rw-r--r-- | ldo.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.22 1998/01/27 21:21:27 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.23 1998/01/28 17:47:05 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -401,7 +401,10 @@ int lua_dostring (char *str) | |||
401 | if (str == NULL) return 1; | 401 | if (str == NULL) return 1; |
402 | sprintf(name, "(dostring) >> \"%." SSIZE_PREF "s\"", str); | 402 | sprintf(name, "(dostring) >> \"%." SSIZE_PREF "s\"", str); |
403 | temp = strchr(name, '\n'); | 403 | temp = strchr(name, '\n'); |
404 | if (temp) *temp = 0; /* end string after first line */ | 404 | if (temp) { /* end string after first line */ |
405 | *temp = '"'; | ||
406 | *(temp+1) = 0; | ||
407 | } | ||
405 | luaZ_sopen(&z, str, name); | 408 | luaZ_sopen(&z, str, name); |
406 | status = do_main(&z, 0); | 409 | status = do_main(&z, 0); |
407 | return status; | 410 | return status; |