diff options
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/extend.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c index e14821aeb9b..da4a51c56e9 100644 --- a/usr.bin/mg/extend.c +++ b/usr.bin/mg/extend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: extend.c,v 1.24 2002/03/11 13:08:51 vincent Exp $ */ +/* $OpenBSD: extend.c,v 1.25 2002/05/29 12:28:45 vincent Exp $ */ /* * Extended (M-X) commands, rebinding, and startup file processing. @@ -625,7 +625,7 @@ evalfile(int f, int n) int load(const char *fname) { - int s = TRUE; + int s = TRUE, line; int nbytes = 0; char excbuf[128]; @@ -636,11 +636,13 @@ load(const char *fname) if (ffropen(fname, NULL) != FIOSUC) return FALSE; + line = 0; while ((s = ffgetline(excbuf, sizeof(excbuf) - 1, &nbytes)) == FIOSUC) { + line++; excbuf[nbytes] = '\0'; if (excline(excbuf) != TRUE) { s = FIOERR; - ewprintf("Error loading file %s", fname); + ewprintf("Error loading file %s at line %d", fname, line); break; } } |