* ch-exp.y (match_string_literal): Allow a zero-length string.
authorPer Bothner <per@bothner.com>
Sun, 23 Jan 1994 20:42:00 +0000 (20:42 +0000)
committerPer Bothner <per@bothner.com>
Sun, 23 Jan 1994 20:42:00 +0000 (20:42 +0000)
* ch-lang.c (chill_printstr):  Don't print zero-length string funny.

gdb/ChangeLog
gdb/ch-exp.y
gdb/ch-lang.c

index 477e03af312797617b1803c43b0d16cfa712ca94..4009a093d50dfb6b2f344bb5c6fb0ded12f3c4c5 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jan 21 19:10:44 1994  Per Bothner  (bothner@kalessin.cygnus.com)
+
+       * ch-exp.y (match_string_literal):  Allow a zero-length string.
+       * ch-lang.c (chill_printstr):  Don't print zero-length string funny.
+
 Sat Jan 22 17:08:48 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * i386aix-nat.c (i386_float_info): Reverse order of registers before
index 59ffd3f84a1f4855ae066c58e3a52ca24e859edf..ebef81326e3b877a39551351a2ddd60b8599acb0 100644 (file)
@@ -1335,7 +1335,7 @@ match_float_literal ()
   return (0);
 }
 
-/* Recognize a string literal.  A string literal is a nonzero sequence
+/* Recognize a string literal.  A string literal is a sequence
    of characters enclosed in matching single or double quotes, except that
    a single character inside single quotes is a character literal, which
    we reject as a string literal.  To embed the terminator character inside
@@ -1363,7 +1363,6 @@ match_string_literal ()
       tempbuf[tempbufindex++] = *tokptr;
     }
   if (*tokptr == '\0'                                  /* no terminator */
-      || tempbufindex == 0                             /* no string */
       || (tempbufindex == 1 && *tokptr == '\''))       /* char literal */
     {
       return (0);
@@ -1806,7 +1805,7 @@ yylex ()
       {
        case '\'':
        case '\"':
-         /* First try to match a string literal, which is any nonzero
+         /* First try to match a string literal, which is any
             sequence of characters enclosed in matching single or double
             quotes, except that a single character inside single quotes
             is a character literal, so we have to catch that case also. */
index 32ab8783529085549a694972f1bb411a6451b6e6..3200982caf11a756055bacdb562701c0543f5b3c 100644 (file)
@@ -95,7 +95,7 @@ chill_printstr (stream, string, length, force_ellipses)
 
   if (length == 0)
     {
-      chill_printchar ('\0', stream);
+      fputs_filtered ("\"\"", stream);
       return;
     }
 
This page took 0.027077 seconds and 4 git commands to generate.