diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-09-24 14:30:28 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-09-24 14:30:28 -0300 |
| commit | 6d383202dca4535866a339f17202e40b2775d160 (patch) | |
| tree | b0f1eb749339f1ba917493afbc99a31a72ad7b29 /lua.c | |
| parent | 7b8166d7b3949839bffcc15e167269e4a6d4660c (diff) | |
| download | lua-github-6d383202dca4535866a339f17202e40b2775d160.tar.gz | |
"dofile" and "dostring" may return values.
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 */ |
