*** ex/ex_util.c.orig 2001-06-25 08:19:21.000000000 -0700 --- ex/ex_util.c 2006-05-24 07:46:07.000000000 -0700 *************** *** 67,73 **** BINC_RETW(sp, exp->ibp, exp->ibp_len, off + 1); p = exp->ibp + off; } ! if ((ch = getc(fp)) == EOF && !feof(fp)) { if (errno == EINTR) { errno = 0; clearerr(fp); --- 67,73 ---- BINC_RETW(sp, exp->ibp, exp->ibp_len, off + 1); p = exp->ibp + off; } ! if ((ch = GETC(fp)) == VI_EOF && !feof(fp)) { if (errno == EINTR) { errno = 0; clearerr(fp); *************** *** 75,82 **** } return (1); } ! if (ch == EOF || ch == '\n') { ! if (ch == EOF && !off) return (1); *lenp = off; return (0); --- 75,82 ---- } return (1); } ! if (ch == VI_EOF || ch == '\n') { ! if (ch == VI_EOF && !off) return (1); *lenp = off; return (0); *** vi/v_ulcase.c.orig 2001-06-25 08:19:36.000000000 -0700 --- vi/v_ulcase.c 2006-05-24 07:44:57.000000000 -0700 *************** *** 154,164 **** change = rval = 0; for (p = bp + scno, t = bp + ecno + 1; p < t; ++p) { ch = *(u_char *)p; ! if (islower(ch)) { ! *p = toupper(ch); change = 1; ! } else if (isupper(ch)) { ! *p = tolower(ch); change = 1; } } --- 154,164 ---- change = rval = 0; for (p = bp + scno, t = bp + ecno + 1; p < t; ++p) { ch = *(u_char *)p; ! if (ISLOWER(*p)) { ! *p = TOUPPER(*p); change = 1; ! } else if (ISUPPER(*p)) { ! *p = TOLOWER(*p); change = 1; } } *** common/multibyte.h.orig 2001-06-28 09:02:29.000000000 -0700 --- common/multibyte.h 2006-05-24 07:44:43.000000000 -0700 *************** *** 19,25 **** --- 19,30 ---- #define STRCMP wcscmp #define STRPBRK wcspbrk #define TOUPPER towupper + #define TOLOWER towlower + #define ISUPPER iswupper + #define ISLOWER iswlower #define STRSET wmemset + #define GETC getwc + #define VI_EOF WEOF #define L(ch) L ## ch *************** *** 38,44 **** --- 43,54 ---- #define STRCMP strcmp #define STRPBRK strpbrk #define TOUPPER toupper + #define TOLOWER tolower + #define ISUPPER isupper + #define ISLOWER islower #define STRSET memset + #define GETC getc + #define VI_EOF EOF #define L(ch) ch *** ex/ex_subst.c.orig 2001-06-25 08:19:20.000000000 -0700 --- ex/ex_subst.c 2006-05-24 10:28:41.000000000 -0700 *************** *** 909,915 **** } if (LF_ISSET(SEARCH_ICL)) { iclower: for (p = ptrn, len = plen; len > 0; ++p, --len) ! if (isupper(*p)) break; if (len == 0) reflags |= REG_ICASE; --- 909,915 ---- } if (LF_ISSET(SEARCH_ICL)) { iclower: for (p = ptrn, len = plen; len > 0; ++p, --len) ! if (ISUPPER(*p)) break; if (len == 0) reflags |= REG_ICASE; *************** *** 1363,1377 **** conv = C_NOTSET; \ /* FALLTHROUGH */ \ case C_LOWER: \ ! if (isupper(__ch)) \ ! __ch = tolower(__ch); \ break; \ case C_ONEUPPER: \ conv = C_NOTSET; \ /* FALLTHROUGH */ \ case C_UPPER: \ ! if (islower(__ch)) \ ! __ch = toupper(__ch); \ break; \ default: \ abort(); \ --- 1363,1377 ---- conv = C_NOTSET; \ /* FALLTHROUGH */ \ case C_LOWER: \ ! if (ISUPPER(__ch)) \ ! __ch = TOLOWER(__ch); \ break; \ case C_ONEUPPER: \ conv = C_NOTSET; \ /* FALLTHROUGH */ \ case C_UPPER: \ ! if (ISLOWER(__ch)) \ ! __ch = TOUPPER(__ch); \ break; \ default: \ abort(); \