aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cb
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-03-25 18:32:51 +0000
committerrsc <devnull@localhost>2007-03-25 18:32:51 +0000
commit79049567a0fac8707ea3f2927403445bdb2394fa (patch)
treef8240bf89e8bb3452fe4e3cee6000b697723ad17 /src/cmd/cb
parentff3dce55bfbc7da32db11803f2acac7ec30c35c9 (diff)
downloadplan9port-79049567a0fac8707ea3f2927403445bdb2394fa.tar.gz
plan9port-79049567a0fac8707ea3f2927403445bdb2394fa.tar.bz2
plan9port-79049567a0fac8707ea3f2927403445bdb2394fa.zip
try to handle Beof in the macros (Michael Teichgräber)
Diffstat (limited to 'src/cmd/cb')
-rw-r--r--src/cmd/cb/cb.c6
-rw-r--r--src/cmd/cb/cbtype.c2
-rw-r--r--src/cmd/cb/cbtype.h22
3 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/cb/cb.c b/src/cmd/cb/cb.c
index 761ccf12..0b245896 100644
--- a/src/cmd/cb/cb.c
+++ b/src/cmd/cb/cb.c
@@ -685,7 +685,7 @@ gotop(int c)
char *a, *b;
op_ptr = optmp;
*op_ptr++ = c;
- while (isop(( *op_ptr = getch())))op_ptr++;
+ while (isop((uchar)( *op_ptr = getch())))op_ptr++;
if(!strict)unget(*op_ptr);
else if (*op_ptr != ' ')unget( *op_ptr);
*op_ptr = '\0';
@@ -845,7 +845,7 @@ lookup(char *first, char *last)
ptr = key;
while ((ckey = ptr->name) != 0){
for (k = cptr; (*ckey == *k && *ckey != '\0'); k++, ckey++);
- if(*ckey=='\0' && (k==last|| (k<last && !isalnum(*k)))){
+ if(*ckey=='\0' && (k==last|| (k<last && !isalnum((uchar)*k)))){
opflag = 1;
lastlook = 0;
return(ptr);
@@ -955,7 +955,7 @@ getnext(int must){
}
tp = lastplace;
if(inswitch && tptr <= lastplace)
- if (isalnum(*lastplace)||ispunct(*lastplace)||isop(*lastplace))return(lastplace);
+ if (isalnum((uchar)*lastplace)||ispunct((uchar)*lastplace)||isop((uchar)*lastplace))return(lastplace);
space:
while(isspace(c=Bgetc(input)))puttmp(c,1);
beg = tp;
diff --git a/src/cmd/cb/cbtype.c b/src/cmd/cb/cbtype.c
index b90cf6f6..a3a99725 100644
--- a/src/cmd/cb/cbtype.c
+++ b/src/cmd/cb/cbtype.c
@@ -1,6 +1,6 @@
#include "cbtype.h"
-unsigned char _cbtype_[] = {
+unsigned char _cbtype_[257] = {
0,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
diff --git a/src/cmd/cb/cbtype.h b/src/cmd/cb/cbtype.h
index e41d5002..0999e58f 100644
--- a/src/cmd/cb/cbtype.h
+++ b/src/cmd/cb/cbtype.h
@@ -34,17 +34,17 @@ extern unsigned char _cbtype_[]; /* in /usr/src/libc/gen/ctype_.c */
#undef tolower
#undef toascii
-#define isop(c) ((_cbtype_+1)[(uchar)(c)]&_O)
-#define isalpha(c) ((_cbtype_+1)[(uchar)(c)]&(_U|_L))
-#define isupper(c) ((_cbtype_+1)[(uchar)(c)]&_U)
-#define islower(c) ((_cbtype_+1)[(uchar)(c)]&_L)
-#define isdigit(c) ((_cbtype_+1)[(uchar)(c)]&_N)
-#define isxdigit(c) ((_cbtype_+1)[(uchar)(c)]&(_N|_X))
-#define isspace(c) ((_cbtype_+1)[(uchar)(c)]&_S)
-#define ispunct(c) ((_cbtype_+1)[(uchar)(c)]&_P)
-#define isalnum(c) ((_cbtype_+1)[(uchar)(c)]&(_U|_L|_N))
-#define isprint(c) ((_cbtype_+1)[(uchar)(c)]&(_P|_U|_L|_N))
-#define iscntrl(c) ((_cbtype_+1)[(uchar)(c)]&_C)
+#define isop(c) ((_cbtype_+1)[c]&_O)
+#define isalpha(c) ((_cbtype_+1)[c]&(_U|_L))
+#define isupper(c) ((_cbtype_+1)[c]&_U)
+#define islower(c) ((_cbtype_+1)[c]&_L)
+#define isdigit(c) ((_cbtype_+1)[c]&_N)
+#define isxdigit(c) ((_cbtype_+1)[c]&(_N|_X))
+#define isspace(c) ((_cbtype_+1)[c]&_S)
+#define ispunct(c) ((_cbtype_+1)[c]&_P)
+#define isalnum(c) ((_cbtype_+1)[c]&(_U|_L|_N))
+#define isprint(c) ((_cbtype_+1)[c]&(_P|_U|_L|_N))
+#define iscntrl(c) ((_cbtype_+1)[c]&_C)
#define isascii(c) ((unsigned)(c)<=0177)
#define toupper(c) ((c)-'a'+'A')
#define tolower(c) ((c)-'A'+'a')