summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 8019756220..6a406385d9 100644
--- a/toke.c
+++ b/toke.c
@@ -162,7 +162,7 @@ check_uni() {
return;
while (isSPACE(*last_uni))
last_uni++;
- for (s = last_uni; isALNUM(*s); s++) ;
+ for (s = last_uni; isALNUM(*s) || *s == '-'; s++) ;
ch = *s;
*s = '\0';
warn("Warning: Use of \"%s\" without parens is ambiguous", last_uni);
@@ -442,6 +442,7 @@ yylex()
case '-':
if (s[1] && isALPHA(s[1]) && !isALPHA(s[2])) {
s++;
+ last_uni = oldbufptr;
switch (*s++) {
case 'r': FTST(O_FTEREAD);
case 'w': FTST(O_FTEWRITE);
@@ -2300,6 +2301,7 @@ int in_what;
STR *tmpstr;
STR *tmpstr2 = Nullstr;
char *tmps;
+ char *start;
bool dorange = FALSE;
CLINE;
@@ -2397,7 +2399,7 @@ int in_what;
}
s++;
}
- s = d = tmpstr->str_ptr; /* assuming shrinkage only */
+ s = d = start = tmpstr->str_ptr; /* assuming shrinkage only */
while (s < send || dorange) {
if (in_what & SCAN_TR) {
if (dorange) {
@@ -2415,10 +2417,11 @@ int in_what;
max = d[1] & 0377;
for (i = (*d & 0377); i <= max; i++)
*d++ = i;
+ start = s;
dorange = FALSE;
continue;
}
- else if (*s == '-' && s+1 < send && d != tmpstr->str_ptr) {
+ else if (*s == '-' && s+1 < send && s != start) {
dorange = TRUE;
s++;
}