mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
* app.c (do_scrub_chars): Match open and close quote of strings.
Remove redundant EOF test in case 7.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2005-09-29 Arnold Metselaar <arnold.metselaar@planet.nl>
|
||||||
|
Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* app.c (do_scrub_chars): Match open and close quote of strings.
|
||||||
|
Remove redundant EOF test in case 7.
|
||||||
|
|
||||||
2005-09-28 Jan Beulich <jbeulich@novell.com>
|
2005-09-28 Jan Beulich <jbeulich@novell.com>
|
||||||
|
|
||||||
* config/tc-i386.c (reloc): Disable signedness check for 4-byte
|
* config/tc-i386.c (reloc): Disable signedness check for 4-byte
|
||||||
|
21
gas/app.c
21
gas/app.c
@ -345,6 +345,8 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
char *fromend;
|
char *fromend;
|
||||||
int fromlen;
|
int fromlen;
|
||||||
register int ch, ch2 = 0;
|
register int ch, ch2 = 0;
|
||||||
|
/* Character that started the string we're working on. */
|
||||||
|
static char quotechar;
|
||||||
|
|
||||||
/*State 0: beginning of normal line
|
/*State 0: beginning of normal line
|
||||||
1: After first whitespace on line (flush more white)
|
1: After first whitespace on line (flush more white)
|
||||||
@ -536,11 +538,8 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
for (s = from; s < fromend; s++)
|
for (s = from; s < fromend; s++)
|
||||||
{
|
{
|
||||||
ch = *s;
|
ch = *s;
|
||||||
/* This condition must be changed if the type of any
|
|
||||||
other character can be LEX_IS_STRINGQUOTE. */
|
|
||||||
if (ch == '\\'
|
if (ch == '\\'
|
||||||
|| ch == '"'
|
|| ch == quotechar
|
||||||
|| ch == '\''
|
|
||||||
|| ch == '\n')
|
|| ch == '\n')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -558,12 +557,12 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
ch = GET ();
|
ch = GET ();
|
||||||
if (ch == EOF)
|
if (ch == EOF)
|
||||||
{
|
{
|
||||||
as_warn (_("end of file in string; inserted '\"'"));
|
as_warn (_("end of file in string; '%c' inserted"), quotechar);
|
||||||
state = old_state;
|
state = old_state;
|
||||||
UNGET ('\n');
|
UNGET ('\n');
|
||||||
PUT ('"');
|
PUT (quotechar);
|
||||||
}
|
}
|
||||||
else if (lex[ch] == LEX_IS_STRINGQUOTE)
|
else if (ch == quotechar)
|
||||||
{
|
{
|
||||||
state = old_state;
|
state = old_state;
|
||||||
PUT (ch);
|
PUT (ch);
|
||||||
@ -603,8 +602,8 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case EOF:
|
case EOF:
|
||||||
as_warn (_("end of file in string; '\"' inserted"));
|
as_warn (_("end of file in string; '%c' inserted"), quotechar);
|
||||||
PUT ('"');
|
PUT (quotechar);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case '"':
|
case '"':
|
||||||
@ -638,10 +637,9 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
ch = GET ();
|
ch = GET ();
|
||||||
|
quotechar = ch;
|
||||||
state = 5;
|
state = 5;
|
||||||
old_state = 8;
|
old_state = 8;
|
||||||
if (ch == EOF)
|
|
||||||
goto fromeof;
|
|
||||||
PUT (ch);
|
PUT (ch);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -975,6 +973,7 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LEX_IS_STRINGQUOTE:
|
case LEX_IS_STRINGQUOTE:
|
||||||
|
quotechar = ch;
|
||||||
if (state == 10)
|
if (state == 10)
|
||||||
{
|
{
|
||||||
/* Preserve the whitespace in foo "bar". */
|
/* Preserve the whitespace in foo "bar". */
|
||||||
|
Reference in New Issue
Block a user