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.
This commit is contained in:
parent
3942352316
commit
1fd716b9b2
2 changed files with 28 additions and 11 deletions
|
@ -1,3 +1,10 @@
|
|||
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.
|
||||
|
||||
2001-09-25 Geoff Berry <geoff.berry@bops.com>
|
||||
|
||||
* listing.c (buffer_line): Don't write past the end of `line' when
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue