From 1fd716b9b2e2ef2982b2e5ee4456c403e040104b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 26 Sep 2001 20:32:17 +0000 Subject: 2001-09-26 Jeff Johnston * input-file.c (input_file_open): When reading the first line looking for #NO_APP, prepare for the possibility of finding #APP instead. Also fix algorithm to allow white-space to follow either #NO_APP or #APP directives. --- gas/ChangeLog | 7 +++++++ gas/input-file.c | 32 +++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 3d3000d..7315f38 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2001-09-26 Jeff Johnston + + * input-file.c (input_file_open): When reading the + first line looking for #NO_APP, prepare for the possibility + of finding #APP instead. Also fix algorithm to allow + white-space to follow either #NO_APP or #APP directives. + 2001-09-25 Geoff Berry * listing.c (buffer_line): Don't write past the end of `line' when diff --git a/gas/input-file.c b/gas/input-file.c index 0b6c9e0..fcd710f 100644 --- a/gas/input-file.c +++ b/gas/input-file.c @@ -157,19 +157,29 @@ input_file_open (filename, pre) /* Begins with comment, may not want to preprocess. */ c = getc (f_in); if (c == 'N') - { - fgets (buf, 80, f_in); - if (!strcmp (buf, "O_APP\n")) - preprocess = 0; - if (!strchr (buf, '\n')) - ungetc ('#', f_in); /* It was longer. */ - else - ungetc ('\n', f_in); - } + { + fgets (buf, 80, f_in); + if (!strncmp (buf, "O_APP", 5) && isspace (buf[5])) + preprocess = 0; + if (!strchr (buf, '\n')) + ungetc ('#', f_in); /* It was longer. */ + else + ungetc ('\n', f_in); + } + else if (c == 'A') + { + fgets (buf, 80, f_in); + if (!strncmp (buf, "PP", 2) && isspace (buf[2])) + preprocess = 1; + if (!strchr (buf, '\n')) + ungetc ('#', f_in); + else + ungetc ('\n', f_in); + } else if (c == '\n') - ungetc ('\n', f_in); + ungetc ('\n', f_in); else - ungetc ('#', f_in); + ungetc ('#', f_in); } else ungetc (c, f_in); -- cgit v1.1