diff options
author | 2016-04-11 19:54:53 +0000 | |
---|---|---|
committer | 2016-04-11 19:54:53 +0000 | |
commit | 5c93237dc61741a77e4aedea71fcbacffe8f97ad (patch) | |
tree | bc0e95ee0e85ecbc603cd014b3d6702559a8323f /lib/libedit/filecomplete.c | |
parent | - In isin(), quote $_b to ensure it's treated as string not as pattern. (diff) | |
download | wireguard-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/filecomplete.c')
-rw-r--r-- | lib/libedit/filecomplete.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c index bf283d8676f..9f56be234cf 100644 --- a/lib/libedit/filecomplete.c +++ b/lib/libedit/filecomplete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filecomplete.c,v 1.10 2016/04/09 20:28:27 schwarze Exp $ */ +/* $OpenBSD: filecomplete.c,v 1.11 2016/04/11 19:54:54 schwarze Exp $ */ /* $NetBSD: filecomplete.c,v 1.22 2010/12/02 04:42:46 dholland Exp $ */ /*- @@ -394,7 +394,7 @@ fn_complete(EditLine *el, const char *(*app_func)(const char *), size_t query_items, int *completion_type, int *over, int *point, int *end) { - const TYPE(LineInfo) *li; + const LineInfoW *li; Char *temp; char **matches; const Char *ctemp; @@ -415,16 +415,16 @@ fn_complete(EditLine *el, app_func = append_char_function; /* We now look backwards for the start of a filename/variable word */ - li = FUN(el,line)(el); + li = el_wline(el); ctemp = li->cursor; while (ctemp > li->buffer - && !Strchr(word_break, ctemp[-1]) - && (!special_prefixes || !Strchr(special_prefixes, ctemp[-1]) ) ) + && !wcschr(word_break, ctemp[-1]) + && (!special_prefixes || !wcschr(special_prefixes, ctemp[-1]) ) ) ctemp--; len = li->cursor - ctemp; temp = reallocarray(NULL, len + 1, sizeof(*temp)); - (void)Strncpy(temp, ctemp, len); + (void)wcsncpy(temp, ctemp, len); temp[len] = '\0'; /* these can be used by function called in completion_matches() */ @@ -460,7 +460,7 @@ fn_complete(EditLine *el, */ if (matches[0][0] != '\0') { el_deletestr(el, (int) len); - FUN(el,insertstr)(el, + el_winsertstr(el, ct_decode_string(matches[0], &el->el_scratch)); } @@ -473,7 +473,7 @@ fn_complete(EditLine *el, * it, unless we do filename completion and the * object is a directory. */ - FUN(el,insertstr)(el, + el_winsertstr(el, ct_decode_string((*app_func)(matches[0]), &el->el_scratch)); } else if (what_to_do == '!') { |