aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
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];
}