summaryrefslogtreecommitdiffstats
path: root/lib/libedit/common.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-04-11 19:54:53 +0000
committerschwarze <schwarze@openbsd.org>2016-04-11 19:54:53 +0000
commit5c93237dc61741a77e4aedea71fcbacffe8f97ad (patch)
treebc0e95ee0e85ecbc603cd014b3d6702559a8323f /lib/libedit/common.c
parent- In isin(), quote $_b to ensure it's treated as string not as pattern. (diff)
downloadwireguard-openbsd-5c93237dc61741a77e4aedea71fcbacffe8f97ad.tar.xz
wireguard-openbsd-5c93237dc61741a77e4aedea71fcbacffe8f97ad.zip
Move wrapper macros to the two files actually needing them:
FUNW, Strlen, Strdup, Strcmp, Strncmp, Strncpy, Strncat -> history.c Strchr, tok_strdup -> tokenizer.c FUN, TYPE, STR -> both of these files OK martijn@ Also proofread by Christian Heckendorf <mbie at ulmus dot me> who reported some whitespace issues in parse.c.
Diffstat (limited to 'lib/libedit/common.c')
-rw-r--r--lib/libedit/common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libedit/common.c b/lib/libedit/common.c
index e1bb83bb294..4d101a47201 100644
--- a/lib/libedit/common.c
+++ b/lib/libedit/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.17 2016/04/09 20:15:26 schwarze Exp $ */
+/* $OpenBSD: common.c,v 1.18 2016/04/11 19:54:54 schwarze Exp $ */
/* $NetBSD: common.c,v 1.24 2009/12/30 22:37:40 christos Exp $ */
/*-
@@ -648,7 +648,7 @@ ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
if (el->el_history.eventno == 0) { /* save the current buffer
* away */
- (void) Strncpy(el->el_history.buf, el->el_line.buffer,
+ (void) wcsncpy(el->el_history.buf, el->el_line.buffer,
EL_BUFSIZ);
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
@@ -720,7 +720,7 @@ ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
return CC_ERROR;
}
if (el->el_history.eventno == 0) {
- (void) Strncpy(el->el_history.buf, el->el_line.buffer,
+ (void) wcsncpy(el->el_history.buf, el->el_line.buffer,
EL_BUFSIZ);
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
@@ -741,7 +741,7 @@ ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
- if ((Strncmp(hp, el->el_line.buffer, (size_t)
+ if ((wcsncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar - el->el_line.buffer]) &&
c_hmatch(el, hp)) {
@@ -796,7 +796,7 @@ ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
- if ((Strncmp(hp, el->el_line.buffer, (size_t)
+ if ((wcsncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar - el->el_line.buffer]) &&
c_hmatch(el, hp))
@@ -906,7 +906,7 @@ ed_command(EditLine *el, wint_t c __attribute__((__unused__)))
Char tmpbuf[EL_BUFSIZ];
int tmplen;
- tmplen = c_gets(el, tmpbuf, STR("\n: "));
+ tmplen = c_gets(el, tmpbuf, L"\n: ");
terminal__putc(el, '\n');
if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1)