From 5c23a8619bc282e998050561809a832f2bb8c6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 20 Jul 2021 10:20:54 +0200 Subject: Print line number on unrecognized field error --- fref.lex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fref.lex b/fref.lex index 91ea0e0..41fa126 100644 --- a/fref.lex +++ b/fref.lex @@ -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); -- cgit v1.2.3