aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-07-07 21:33:50 +0000
committerTom Tromey <tromey@redhat.com>2009-07-07 21:33:50 +0000
commit30b66ecc739234c58f8f1aca25a8c068b09f9cc8 (patch)
tree070269a7bacad563ef335cdac2c05c8ab3cca332 /gdb/c-exp.y
parent7ec721f405a1b9bb6598e80f5919ba7a27e997f6 (diff)
downloadfsf-binutils-gdb-30b66ecc739234c58f8f1aca25a8c068b09f9cc8.zip
fsf-binutils-gdb-30b66ecc739234c58f8f1aca25a8c068b09f9cc8.tar.gz
fsf-binutils-gdb-30b66ecc739234c58f8f1aca25a8c068b09f9cc8.tar.bz2
gdb
* c-lang.c (convert_octal): Only allow 3 octal digits. (print_wchar): Prefer 3-digit octal form. Fall back to hex if needed. * c-exp.y (c_parse_escape): Only allow 3 octal digits. gdb/testsuite * gdb.base/call-rt-st.exp: Update for change to escape output. * gdb.base/callfuncs.exp: Likewise. * gdb.base/charset.exp: Likewise. * gdb.base/constvars.exp: Likewise. * gdb.base/long_long.exp: Likewise. * gdb.base/pointers.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/setvar.exp: Likewise. * gdb.base/store.exp: Likewise. * gdb.cp/ref-types.exp: Likewise. * gdb.mi/mi-var-child.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * gdb.base/charset.exp: Test octal escape sequence length. Update for change to escape output.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y21
1 files changed, 13 insertions, 8 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index d0a6332..aacc112 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1440,14 +1440,19 @@ c_parse_escape (char **ptr, struct obstack *output)
case '5':
case '6':
case '7':
- if (output)
- obstack_grow_str (output, "\\");
- while (isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9')
- {
- if (output)
- obstack_1grow (output, *tokptr);
- ++tokptr;
- }
+ {
+ int i;
+ if (output)
+ obstack_grow_str (output, "\\");
+ for (i = 0;
+ i < 3 && isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9';
+ ++i)
+ {
+ if (output)
+ obstack_1grow (output, *tokptr);
+ ++tokptr;
+ }
+ }
break;
/* We handle UCNs later. We could handle them here, but that