aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1994-01-23 20:42:00 +0000
committerPer Bothner <per@bothner.com>1994-01-23 20:42:00 +0000
commit96b6b765fc847223314b35ba29b4941cdce49770 (patch)
tree772b1e71f17d49da40fbf385cea47b8a8c527665
parent5fd519935375244703d86b9ceaa71a041afb60ff (diff)
downloadfsf-binutils-gdb-96b6b765fc847223314b35ba29b4941cdce49770.zip
fsf-binutils-gdb-96b6b765fc847223314b35ba29b4941cdce49770.tar.gz
fsf-binutils-gdb-96b6b765fc847223314b35ba29b4941cdce49770.tar.bz2
* ch-exp.y (match_string_literal): Allow a zero-length string.
* ch-lang.c (chill_printstr): Don't print zero-length string funny.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ch-exp.y5
-rw-r--r--gdb/ch-lang.c2
3 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 477e03a..4009a09 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y
index 59ffd3f..ebef813 100644
--- a/gdb/ch-exp.y
+++ b/gdb/ch-exp.y
@@ -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. */
diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c
index 32ab878..3200982 100644
--- a/gdb/ch-lang.c
+++ b/gdb/ch-lang.c
@@ -95,7 +95,7 @@ chill_printstr (stream, string, length, force_ellipses)
if (length == 0)
{
- chill_printchar ('\0', stream);
+ fputs_filtered ("\"\"", stream);
return;
}