diff options
author | Larry Wall <lwall@netlabs.com> | 1993-02-04 22:50:33 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1993-02-04 22:50:33 +0000 |
commit | e334a159a5616cab575044bafaf68f75b7bb3a16 (patch) | |
tree | 47369293eb7417e5322f7fe46e1a1cfc0d9c69ef /toke.c | |
parent | 514dae0dba791ec01681adb3b3946a7646e146b3 (diff) | |
download | perl-e334a159a5616cab575044bafaf68f75b7bb3a16.tar.gz |
perl 4.0 patch 36: (combined patch)perl-4.0.36
Since Ed Barton sent me a patch for the malignent form of "Malformed
cmd links", I finally broke down and made a patch for the various
other little things that have been accumulating on version 4.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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++; } |