diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-12 12:56:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-12 12:56:03 -0300 |
commit | 40306b10db342cb0be4144fdd451e1128fe7ec55 (patch) | |
tree | 987012a82037f10b2c66ef678a4e74136191b7b0 /iolib.c | |
parent | 5eff5d3eac37a7596550a881d1db470fef0c1648 (diff) | |
download | lua-40306b10db342cb0be4144fdd451e1128fe7ec55.tar.gz lua-40306b10db342cb0be4144fdd451e1128fe7ec55.tar.bz2 lua-40306b10db342cb0be4144fdd451e1128fe7ec55.zip |
small corrections.
Diffstat (limited to 'iolib.c')
-rw-r--r-- | iolib.c | 30 |
1 files changed, 4 insertions, 26 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Input/output library to LUA | 3 | ** Input/output library to LUA |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_iolib="$Id: iolib.c,v 1.36 1996/02/16 13:10:14 roberto Exp roberto $"; | 6 | char *rcs_iolib="$Id: iolib.c,v 1.38 1996/03/12 13:14:52 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <ctype.h> | 9 | #include <ctype.h> |
@@ -535,7 +535,7 @@ static void io_debug (void) | |||
535 | { | 535 | { |
536 | char buffer[250]; | 536 | char buffer[250]; |
537 | fprintf(stderr, "lua_debug> "); | 537 | fprintf(stderr, "lua_debug> "); |
538 | if (gets(buffer) == 0) return; | 538 | if (fgets(buffer, sizeof(buffer), stdin) == 0) return; |
539 | if (strcmp(buffer, "cont") == 0) return; | 539 | if (strcmp(buffer, "cont") == 0) return; |
540 | lua_dostring(buffer); | 540 | lua_dostring(buffer); |
541 | } | 541 | } |
@@ -558,7 +558,7 @@ void lua_printstack (FILE *f) | |||
558 | fprintf(f, "function %s", name); | 558 | fprintf(f, "function %s", name); |
559 | break; | 559 | break; |
560 | case 'f': | 560 | case 'f': |
561 | fprintf(f, "fallback %s", name); | 561 | fprintf(f, "`%s' fallback", name); |
562 | break; | 562 | break; |
563 | default: | 563 | default: |
564 | { | 564 | { |
@@ -574,7 +574,7 @@ void lua_printstack (FILE *f) | |||
574 | } | 574 | } |
575 | } | 575 | } |
576 | if ((currentline = lua_currentline(func)) > 0) | 576 | if ((currentline = lua_currentline(func)) > 0) |
577 | fprintf(f, " at line %d", currentline); | 577 | fprintf(f, " at line %d", currentline); |
578 | fprintf(f, "\n"); | 578 | fprintf(f, "\n"); |
579 | } | 579 | } |
580 | } | 580 | } |
@@ -611,25 +611,3 @@ void iolib_open (void) | |||
611 | lua_setfallback("error", errorfb); | 611 | lua_setfallback("error", errorfb); |
612 | } | 612 | } |
613 | 613 | ||
614 | /* | ||
615 | ** Return user formatted time stamp | ||
616 | * | ||
617 | static void sys_localtime (void) | ||
618 | { | ||
619 | time_t t; | ||
620 | struct tm *tm; | ||
621 | lua_Object o = lua_getparam(1); | ||
622 | |||
623 | time(&t); tm = localtime(&t); | ||
624 | if (lua_isstring(o)) | ||
625 | { | ||
626 | char b[BUFSIZ]; | ||
627 | if (strftime(b,sizeof(b),lua_getstring(o),tm)==0) | ||
628 | lua_pushstring(ctime(&t)); | ||
629 | else | ||
630 | lua_pushstring(b); | ||
631 | } | ||
632 | else | ||
633 | lua_pushstring(ctime(&t)); | ||
634 | } | ||
635 | */ | ||