diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-20 10:20:54 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-21 11:19:55 +0200 |
commit | 5c23a8619bc282e998050561809a832f2bb8c6ce (patch) | |
tree | 5d72e9801cc2c6cecc9c46ec10355f891fe1ffb0 | |
parent | 832c354a05df96c3ec9730b9dcbaa75ee666c3c4 (diff) | |
download | fref-5c23a8619bc282e998050561809a832f2bb8c6ce.tar.gz |
Print line number on unrecognized field error
-rw-r--r-- | fref.lex | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -88,7 +88,8 @@ field(char *t) DO_ENTRIES #undef DO - fprintf(stderr, "%s: unrecognized field %%%.2s\n", name, t); + fprintf(stderr, "%s: unrecognized field %%%.2s at line %d\n", + name, t, lines); exit(1); } @@ -105,8 +106,6 @@ harvard() { int i; -#define EI(a, b) a ? a : b - /* Print label. */ pf("% = ", e.la); @@ -124,7 +123,7 @@ harvard() /* Print title, book/journal. */ if(*e.bo || *e.jo){ pf("%.\n", e.ti); - pf("\\fI%\\fP", EI(e.bo, e.jo)); + pf("\\fI%\\fP", e.bo ? e.bo : e.jo); pf(" ("ED" %)", e.ed); }else pf("\\fI%\\fP", e.ti); |