diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 1.31 1999/02/22 14:17:24 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.32 1999/03/04 21:17:26 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -488,7 +488,9 @@ static void errorfb (void) { | |||
488 | default: { | 488 | default: { |
489 | if (linedefined == 0) | 489 | if (linedefined == 0) |
490 | sprintf(buff+strlen(buff), "main of %.50s", buffchunk); | 490 | sprintf(buff+strlen(buff), "main of %.50s", buffchunk); |
491 | else if (linedefined > 0) | 491 | else if (linedefined < 0) |
492 | sprintf(buff+strlen(buff), "%.50s", buffchunk); | ||
493 | else | ||
492 | sprintf(buff+strlen(buff), "function <%d:%.50s>", | 494 | sprintf(buff+strlen(buff), "function <%d:%.50s>", |
493 | linedefined, buffchunk); | 495 | linedefined, buffchunk); |
494 | chunkname = NULL; | 496 | chunkname = NULL; |
@@ -497,7 +499,7 @@ static void errorfb (void) { | |||
497 | if ((currentline = lua_currentline(func)) > 0) | 499 | if ((currentline = lua_currentline(func)) > 0) |
498 | sprintf(buff+strlen(buff), " at line %d", currentline); | 500 | sprintf(buff+strlen(buff), " at line %d", currentline); |
499 | if (chunkname) | 501 | if (chunkname) |
500 | sprintf(buff+strlen(buff), " [in %.50s]", buffchunk); | 502 | sprintf(buff+strlen(buff), " [%.50s]", buffchunk); |
501 | strcat(buff, "\n"); | 503 | strcat(buff, "\n"); |
502 | } | 504 | } |
503 | func = lua_rawgetglobal("_ALERT"); | 505 | func = lua_rawgetglobal("_ALERT"); |