diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-06-23 21:34:41 -0700 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-06-23 21:34:41 -0700 |
| commit | 874d317334fae1ddce316f9b6f4d0ce4e434bf52 (patch) | |
| tree | 929f924d3c3696d3aa9917aca0e7048bbe3e93e8 /ex.h | |
| parent | 15bd7946cc838a3151c357e4b0bc1ab85eecda62 (diff) | |
heirloom vi fixes from arch AUR
Diffstat (limited to 'ex.h')
| -rw-r--r-- | ex.h | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -136,6 +136,7 @@ #endif #ifdef MB +int wcwidth(wchar_t); #include <wchar.h> #include <wctype.h> #endif @@ -191,6 +192,8 @@ typedef short line; typedef int line; #endif +typedef short bool; + #ifdef LARGEF typedef off_t bloc; #else @@ -252,9 +255,6 @@ typedef short bbloc; #ifdef EOF #undef EOF #endif -#ifdef printf -#undef printf -#endif #ifdef vprintf #undef vprintf #endif @@ -441,7 +441,8 @@ var int exitoneof; /* exit command loop on EOF */ /* * Macros */ -#define CP(a, b) (ignore(movestr(a, b))) +#define Copy(t, f, s) memmove(t, f, s) +#define CP(a, b) memmove(a, b, strlen(b) + 1) /* * FIXUNDO: do we want to mung undo vars? * Usually yes unless in a macro or global. @@ -449,7 +450,7 @@ var int exitoneof; /* exit command loop on EOF */ #define FIXUNDO (inopen >= 0 && (inopen || !inglobal)) #define ckaw() {if (chng && value(AUTOWRITE)) wop(0);} #define copy(a,b,c) Copy((char *) (a), (char *) (b), (c)) -#define eq(a, b) ((a) && (b) && strcmp(a, b) == 0) +#define eq(a, b) ((void *)(a) != NULL && (void *)(b) != NULL && strcmp(a, b) == 0) #define getexit(a) copy(a, resetlab, sizeof (JMP_BUF)) #define lastchar() lastc #define outchar(c) (*Outchar)(c) @@ -551,7 +552,7 @@ var int mb_cur_max; ((c) = *(s) & 0377, (n) = 1)) #define colsc(c) (mb_cur_max > 1 && ((c)&0177) != (c) ? wcwidth(c) : 1) #define skipleft(l, p) (mb_cur_max > 1 && ((p)[0]&0200 || \ - (p)>(l) && (p)[-1]&0200) ? wskipleft(l, p) : -1) + ((p)>(l) && (p)[-1]&0200)) ? wskipleft(l, p) : -1) #define skipright(l, p) (mb_cur_max > 1 && (p)>=(l) && (p)[0]&0200 ? \ wskipright(l, p) : 1) #define samechar(cp, c) (mb_cur_max > 1 && *(cp)&0200 ? wsamechar(cp, c) : \ @@ -562,8 +563,8 @@ var int mb_cur_max; #define xisspace(c) (mb_cur_max > 1 ? iswspace(c) : isspace(c)) #define xisupper(c) (mb_cur_max > 1 ? iswupper(c) : isupper(c)) #define xislower(c) (mb_cur_max > 1 ? iswlower(c) : islower(c)) -#define xtolower(c) (mb_cur_max > 1 ? towlower(c) : tolower(c)) -#define xtoupper(c) (mb_cur_max > 1 ? towupper(c) : toupper(c)) +#define xtolower(c) (mb_cur_max > 1 ? towlower(c) : (wint_t)tolower(c)) +#define xtoupper(c) (mb_cur_max > 1 ? towupper(c) : (wint_t)toupper(c)) #else /* !MB */ #define nextc(c, s, n) ((c) = *(s) & 0377, (n) = 1) #define colsc(c) (1) |
