+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>
* config/tc-i386.c (reloc): Disable signedness check for 4-byte
char *fromend;
int fromlen;
register int ch, ch2 = 0;
+ /* Character that started the string we're working on. */
+ static char quotechar;
/*State 0: beginning of normal line
1: After first whitespace on line (flush more white)
for (s = from; s < fromend; s++)
{
ch = *s;
- /* This condition must be changed if the type of any
- other character can be LEX_IS_STRINGQUOTE. */
if (ch == '\\'
- || ch == '"'
- || ch == '\''
+ || ch == quotechar
|| ch == '\n')
break;
}
ch = GET ();
if (ch == EOF)
{
- as_warn (_("end of file in string; inserted '\"'"));
+ as_warn (_("end of file in string; '%c' inserted"), quotechar);
state = old_state;
UNGET ('\n');
- PUT ('"');
+ PUT (quotechar);
}
- else if (lex[ch] == LEX_IS_STRINGQUOTE)
+ else if (ch == quotechar)
{
state = old_state;
PUT (ch);
continue;
case EOF:
- as_warn (_("end of file in string; '\"' inserted"));
- PUT ('"');
+ as_warn (_("end of file in string; '%c' inserted"), quotechar);
+ PUT (quotechar);
continue;
case '"':
case 7:
ch = GET ();
+ quotechar = ch;
state = 5;
old_state = 8;
- if (ch == EOF)
- goto fromeof;
PUT (ch);
continue;
break;
case LEX_IS_STRINGQUOTE:
+ quotechar = ch;
if (state == 10)
{
/* Preserve the whitespace in foo "bar". */