summaryrefslogtreecommitdiff
path: root/lib/libedit
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2010-06-15 22:23:21 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2010-06-15 22:23:21 +0000
commit196ff96e7888b81b3115832f4db9632213007a42 (patch)
tree7cdaa8be2d5df7afd3929ea13d1e043f0995a0cb /lib/libedit
parent8b1f99cdd4a8584f58184e281c56da85335d1674 (diff)
Notes
Diffstat (limited to 'lib/libedit')
-rw-r--r--lib/libedit/filecomplete.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c
index 97ba2d0c02cb..bf0d75909245 100644
--- a/lib/libedit/filecomplete.c
+++ b/lib/libedit/filecomplete.c
@@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$");
#include "histedit.h"
#include "filecomplete.h"
-static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@',
- '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
+static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`',
+ '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
/* Tilde is deliberately omitted here, we treat it specially. */
-static char extra_quote_chars[] = { ')', '}', '\0' };
+static char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' };
/********************************/
@@ -595,6 +595,8 @@ sh_quote(const char *str)
int extra_len = 0;
char *quoted_str, *dst;
+ if (*str == '-' || *str == '+')
+ extra_len += 2;
for (src = str; *src != '\0'; src++)
if (strchr(break_chars, *src) ||
strchr(extra_quote_chars, *src))
@@ -606,6 +608,8 @@ sh_quote(const char *str)
return NULL;
dst = quoted_str;
+ if (*str == '-' || *str == '+')
+ *dst++ = '.', *dst++ = '/';
for (src = str; *src != '\0'; src++) {
if (strchr(break_chars, *src) ||
strchr(extra_quote_chars, *src))