summaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-09-24 14:30:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-09-24 14:30:28 -0300
commit6d383202dca4535866a339f17202e40b2775d160 (patch)
treeb0f1eb749339f1ba917493afbc99a31a72ad7b29 /lua.c
parent7b8166d7b3949839bffcc15e167269e4a6d4660c (diff)
downloadlua-github-6d383202dca4535866a339f17202e40b2775d160.tar.gz
"dofile" and "dostring" may return values.
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lua.c b/lua.c
index a58e87ad..d5622d86 100644
--- a/lua.c
+++ b/lua.c
@@ -3,7 +3,7 @@
** Linguagem para Usuarios de Aplicacao
*/
-char *rcs_lua="$Id: lua.c,v 1.12 1996/07/05 20:55:43 roberto Exp roberto $";
+char *rcs_lua="$Id: lua.c,v 1.13 1996/07/06 20:20:35 roberto Exp roberto $";
#include <stdio.h>
#include <string.h>
@@ -21,11 +21,13 @@ char *rcs_lua="$Id: lua.c,v 1.12 1996/07/05 20:55:43 roberto Exp roberto $";
static void manual_input (void)
{
- if (isatty(0))
- {
- char buffer[250];
- while (fgets(buffer, sizeof(buffer), stdin) != 0)
- lua_dostring(buffer);
+ if (isatty(0)) {
+ char buffer[250];
+ while (fgets(buffer, sizeof(buffer), stdin) != 0) {
+ lua_beginblock();
+ lua_dostring(buffer);
+ lua_endblock();
+ }
}
else
lua_dofile(NULL); /* executes stdin as a file */