From c4ca7db14f74b3562624b723631d10d4073c4efb Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 17 Nov 1989 14:53:05 +0000 Subject: [PATCH] improved #line handling --- lang/cem/cemcom/domacro.c | 7 ++++--- util/cpp/domacro.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lang/cem/cemcom/domacro.c b/lang/cem/cemcom/domacro.c index d427d516f..8fe2da8f8 100644 --- a/lang/cem/cemcom/domacro.c +++ b/lang/cem/cemcom/domacro.c @@ -695,9 +695,10 @@ do_line(l) unsigned int l; { struct token tk; + int t = GetToken(&tk); - LineNumber = l - 1; /* the number of the next input line */ - if (GetToken(&tk) == STRING) /* is there a filespecifier? */ - FileName = tk.tk_bts; SkipRestOfLine(); + LineNumber = l - 1; /* the number of the next input line */ + if (t == STRING) /* is there a filespecifier? */ + FileName = tk.tk_bts; } diff --git a/util/cpp/domacro.c b/util/cpp/domacro.c index 63b9901aa..3aaf9ff2a 100644 --- a/util/cpp/domacro.c +++ b/util/cpp/domacro.c @@ -444,12 +444,13 @@ do_line(l) unsigned int l; { struct token tk; + int t = GetToken(&tk); - LineNumber = l - 1; /* the number of the next input line */ - if (GetToken(&tk) == STRING) /* is there a filespecifier? */ - FileName = tk.tk_str; PushBack(); skipline(); + LineNumber = l - 1; /* the number of the next input line */ + if (t == STRING) /* is there a filespecifier? */ + FileName = tk.tk_str; } PRIVATE int