aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorKung Hsu <kung@cygnus>1994-11-16 00:21:16 +0000
committerKung Hsu <kung@cygnus>1994-11-16 00:21:16 +0000
commite38e7f47a8bde45413d94878b5e9250d8f22cb4e (patch)
tree45107dddffddbe3e74f36e6735561d13bce75a97 /gdb/c-exp.y
parent2d4838fe0dcca00186f623dce94352572ec05dae (diff)
downloadgdb-e38e7f47a8bde45413d94878b5e9250d8f22cb4e.zip
gdb-e38e7f47a8bde45413d94878b5e9250d8f22cb4e.tar.gz
gdb-e38e7f47a8bde45413d94878b5e9250d8f22cb4e.tar.bz2
* c-exp.y (yylex): Fix a bug in template scanning.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index bb87545..e8b0d7e 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1366,7 +1366,12 @@ yylex ()
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
{
if (c == '<')
- while (tokstart[++namelen] != '>');
+ {
+ int i = namelen;
+ while (tokstart[++i] && tokstart[i] != '>');
+ if (tokstart[i] == '>')
+ namelen = i;
+ }
c = tokstart[++namelen];
}