commit 40306b10db342cb0be4144fdd451e1128fe7ec55
parent 5eff5d3eac37a7596550a881d1db470fef0c1648
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 12 Mar 1996 12:55:43 -0300
small corrections.
Diffstat:
2 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/iolib.c b/iolib.c
@@ -3,7 +3,7 @@
** Input/output library to LUA
*/
-char *rcs_iolib="$Id: iolib.c,v 1.36 1996/02/16 13:10:14 roberto Exp roberto $";
+char *rcs_iolib="$Id: iolib.c,v 1.38 1996/03/12 13:14:52 roberto Exp roberto $";
#include <stdio.h>
#include <ctype.h>
@@ -535,7 +535,7 @@ static void io_debug (void)
{
char buffer[250];
fprintf(stderr, "lua_debug> ");
- if (gets(buffer) == 0) return;
+ if (fgets(buffer, sizeof(buffer), stdin) == 0) return;
if (strcmp(buffer, "cont") == 0) return;
lua_dostring(buffer);
}
@@ -558,7 +558,7 @@ void lua_printstack (FILE *f)
fprintf(f, "function %s", name);
break;
case 'f':
- fprintf(f, "fallback %s", name);
+ fprintf(f, "`%s' fallback", name);
break;
default:
{
@@ -574,7 +574,7 @@ void lua_printstack (FILE *f)
}
}
if ((currentline = lua_currentline(func)) > 0)
- fprintf(f, " at line %d", currentline);
+ fprintf(f, " at line %d", currentline);
fprintf(f, "\n");
}
}
@@ -611,25 +611,3 @@ void iolib_open (void)
lua_setfallback("error", errorfb);
}
-/*
-** Return user formatted time stamp
-*
-static void sys_localtime (void)
-{
- time_t t;
- struct tm *tm;
- lua_Object o = lua_getparam(1);
-
- time(&t); tm = localtime(&t);
- if (lua_isstring(o))
- {
- char b[BUFSIZ];
- if (strftime(b,sizeof(b),lua_getstring(o),tm)==0)
- lua_pushstring(ctime(&t));
- else
- lua_pushstring(b);
- }
- else
- lua_pushstring(ctime(&t));
-}
-*/
diff --git a/lua.c b/lua.c
@@ -3,7 +3,7 @@
** Linguagem para Usuarios de Aplicacao
*/
-char *rcs_lua="$Id: lua.c,v 1.6 1995/10/23 13:54:11 roberto Exp roberto $";
+char *rcs_lua="$Id: lua.c,v 1.7 1995/10/31 17:05:35 roberto Exp roberto $";
#include <stdio.h>
#include <string.h>
@@ -44,7 +44,7 @@ static void manual_input (void)
if (isatty(fileno(stdin)))
{
char buffer[250];
- while (gets(buffer) != 0)
+ while (fgets(buffer, sizeof(buffer), stdin) != 0)
lua_dostring(buffer);
}
else