summaryrefslogtreecommitdiffstats
path: root/lib/libedit/filecomplete.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-03-20 23:48:27 +0000
committerschwarze <schwarze@openbsd.org>2016-03-20 23:48:27 +0000
commit7ccfa089d503f0f7c1c22435af04c237b0796118 (patch)
tree6522e595632a0b190dfe2f14b1a5641765a9c2cd /lib/libedit/filecomplete.c
parentdelete useless "typedef int bool_t", use int directly; (diff)
downloadwireguard-openbsd-7ccfa089d503f0f7c1c22435af04c237b0796118.tar.xz
wireguard-openbsd-7ccfa089d503f0f7c1c22435af04c237b0796118.zip
Cleanup of standard header inclusion:
1. Add the missing <errno.h> to sig.c. 2. Do not include standard headers from private headers "chared.h" and "el.h", include them directly where needed. 3. Delete a few needless inclusions of <ctype.h>. 4. Sort the standard headers. 5. Delete _GNU_SOURCE weirdness from histedit.h, that file doesn't even need the access to wcsdup(3) mentioned in the comment. 6. Delete some trailing blanks and blanks before tabs. OK czarkoff@
Diffstat (limited to 'lib/libedit/filecomplete.c')
-rw-r--r--lib/libedit/filecomplete.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c
index 68b99ae2496..82f69099efd 100644
--- a/lib/libedit/filecomplete.c
+++ b/lib/libedit/filecomplete.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: filecomplete.c,v 1.8 2016/03/20 22:57:59 schwarze Exp $ */
+/* $OpenBSD: filecomplete.c,v 1.9 2016/03/20 23:48:27 schwarze Exp $ */
/* $NetBSD: filecomplete.c,v 1.22 2010/12/02 04:42:46 dholland Exp $ */
/*-
@@ -34,16 +34,15 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdio.h>
#include <dirent.h>
-#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
#include <pwd.h>
-#include <ctype.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
#include "el.h"
#include "filecomplete.h"
@@ -442,7 +441,7 @@ fn_complete(EditLine *el,
(int)(cur_off - len), cur_off);
} else
matches = 0;
- if (!attempted_completion_function ||
+ if (!attempted_completion_function ||
(over != NULL && !*over && !matches))
matches = completion_matches(
ct_encode_string(temp, &el->el_scratch), complet_func);
@@ -491,7 +490,7 @@ fn_complete(EditLine *el,
}
/* matches[1] through matches[i-1] are available */
matches_num = i - 1;
-
+
/* newline to get on next line from command line */
(void)fprintf(el->el_outfile, "\n");