diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2001-09-26 20:32:17 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2001-09-26 20:32:17 +0000 |
commit | 2afdcb26c9594a775af3beef2dc11ca75fea421d (patch) | |
tree | f46fd211392ac1be1e665479b3dc7e1e25e478eb /gas/input-file.c | |
parent | 80699cc1158e6902fa7052f15008a7d14011f50c (diff) | |
download | binutils-redhat-2afdcb26c9594a775af3beef2dc11ca75fea421d.tar.gz |
2001-09-26 Jeff Johnston <jjohnstn@redhat.com>
* 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.
Diffstat (limited to 'gas/input-file.c')
-rw-r--r-- | gas/input-file.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/gas/input-file.c b/gas/input-file.c index 0b6c9e01a7..fcd710ffb7 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); |