summaryrefslogtreecommitdiff
path: root/lib/libedit/vi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-04-09 20:15:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-04-09 20:15:27 +0000
commitfcdbfdf8477aba1fd8ec89db86623358fac6671f (patch)
tree2da4f8b44a238399087a75b98b8edd1cff9978d5 /lib/libedit/vi.c
parent80a77eb7c54fcb44f04621ea71a30027fb1da8ba (diff)
Delete 26 wrapper macros and two wrapper functions that are no
longer needed now that we always compile with wide character support, reducing code obfuscation. OK czarkoff@ martijn@. Diff also proofread by Christian Heckendorf <mbie at ulmus dot me>.
Diffstat (limited to 'lib/libedit/vi.c')
-rw-r--r--lib/libedit/vi.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c
index fe06c14d09f..c3f60855f34 100644
--- a/lib/libedit/vi.c
+++ b/lib/libedit/vi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.c,v 1.19 2016/03/22 11:32:18 schwarze Exp $ */
+/* $OpenBSD: vi.c,v 1.20 2016/04/09 20:15:26 schwarze Exp $ */
/* $NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $ */
/*-
@@ -97,7 +97,7 @@ cv_paste(EditLine *el, wint_t c)
if (k->buf == NULL || len == 0)
return CC_ERROR;
#ifdef DEBUG_PASTE
- (void) fprintf(el->el_errfile, "Paste: \"" FSTARSTR "\"\n", (int)len,
+ (void) fprintf(el->el_errfile, "Paste: \"%.*ls\"\n", (int)len,
k->buf);
#endif
@@ -255,10 +255,10 @@ vi_change_case(EditLine *el, wint_t c)
for (i = 0; i < el->el_state.argument; i++) {
c = *el->el_line.cursor;
- if (Isupper(c))
- *el->el_line.cursor = Tolower(c);
- else if (Islower(c))
- *el->el_line.cursor = Toupper(c);
+ if (iswupper(c))
+ *el->el_line.cursor = towlower(c);
+ else if (iswlower(c))
+ *el->el_line.cursor = towupper(c);
if (++el->el_line.cursor >= el->el_line.lastchar) {
el->el_line.cursor--;
@@ -810,7 +810,7 @@ vi_match(EditLine *el, wint_t c __attribute__((__unused__)))
*el->el_line.lastchar = '\0'; /* just in case */
- i = Strcspn(el->el_line.cursor, match_chars);
+ i = wcscspn(el->el_line.cursor, match_chars);
o_ch = el->el_line.cursor[i];
if (o_ch == 0)
return CC_ERROR;
@@ -1035,7 +1035,7 @@ vi_histedit(EditLine *el, wint_t c __attribute__((__unused__)))
}
Strncpy(line, el->el_line.buffer, len);
line[len] = '\0';
- ct_wcstombs(cp, line, TMP_BUFSIZ - 1);
+ wcstombs(cp, line, TMP_BUFSIZ - 1);
cp[TMP_BUFSIZ - 1] = '\0';
len = strlen(cp);
write(fd, cp, len);
@@ -1061,7 +1061,7 @@ vi_histedit(EditLine *el, wint_t c __attribute__((__unused__)))
if (st > 0) {
len = (size_t)(el->el_line.lastchar -
el->el_line.buffer);
- len = ct_mbstowcs(el->el_line.buffer, cp, len);
+ len = mbstowcs(el->el_line.buffer, cp, len);
if (len > 0 && el->el_line.buffer[len -1] == '\n')
--len;
}
@@ -1101,12 +1101,12 @@ vi_history_word(EditLine *el, wint_t c __attribute__((__unused__)))
wep = wsp = 0;
do {
- while (Isspace(*wp))
+ while (iswspace(*wp))
wp++;
if (*wp == 0)
break;
wsp = wp;
- while (*wp && !Isspace(*wp))
+ while (*wp && !iswspace(*wp))
wp++;
wep = wp;
} while ((!el->el_state.doingarg || --el->el_state.argument > 0)