Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109845286
D39839.id121110.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
962 B
Referenced Files
None
Subscribers
None
D39839.id121110.diff
View Options
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -608,6 +608,8 @@
char **matches = NULL;
size_t i = 0, size = 16, uniq;
size_t curpos = end - start, lcstring = -1;
+ const unsigned char *bp;
+ char **rmatches;
in_command_completion = false;
if (start > 0 || memchr("/.~", text[0], 3) != NULL)
@@ -631,7 +633,6 @@
}
while ((entry = readdir(dir)) != NULL) {
struct stat statb;
- char **rmatches;
if (strncmp(entry->d_name, text, curpos) != 0)
continue;
@@ -655,6 +656,18 @@
}
closedir(dir);
}
+ for (bp = builtincmd; *bp != '\0'; bp += 2 + bp[0]) {
+ if (strncmp(bp + 2, text, curpos) != 0)
+ continue;
+ matches[++i] = strndup(bp + 2, bp[0]);
+ if (i < size - 1)
+ continue;
+ size *= 2;
+ rmatches = reallocarray(matches, size, sizeof(matches[0]));
+ if (rmatches == NULL)
+ goto out;
+ matches = rmatches;
+ }
out:
free(free_path);
if (i == 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 6:53 AM (4 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16590401
Default Alt Text
D39839.id121110.diff (962 B)
Attached To
Mode
D39839: sh: also auto-complete built-ins
Attached
Detach File
Event Timeline
Log In to Comment