summaryrefslogtreecommitdiffstats
path: root/lib/libedit/filecomplete.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libedit/filecomplete.c')
-rw-r--r--lib/libedit/filecomplete.c16
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 == '!') {