diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-29 12:28:46 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-29 12:28:46 +0000 |
commit | 032734d23809772db89c0c6142f42d6404a743a6 (patch) | |
tree | a2fb8f4bf826bdaee13148702f272e4f06852737 /usr.bin | |
parent | aafb79f0f9e8b8e613ffe7e8ea9593ef282e0f1b (diff) |
show the line number in the config file when we find an error.
ok art@
Diffstat (limited to 'usr.bin')
-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; } } |