summaryrefslogtreecommitdiff
path: root/lib/libedit
diff options
context:
space:
mode:
authortih <tih@NetBSD.org>2020-01-05 00:03:27 +0000
committertih <tih@NetBSD.org>2020-01-05 00:03:27 +0000
commit62053db6a5929c6fdcd3588eb583b9e22fdfa007 (patch)
treea6d6b64dc4074bbac0ab6838debc43674cf03811 /lib/libedit
parent71272daaa1174d06d12b586a9ed4ba5bf994f74c (diff)
Summary: Remove over-simplified extraneous test
The file name matching code in libedit tries to adjust to the presence of explicit " or ' characters in the input line, but tries too hard. Remove a conditional that goes overboard, and causes the completion code to fail if a quoted string is seen before the filename to be expanded, as in grep 'foo' bar<TAB> Before this change, the above would not expand any possible completions, even if they existed, because it would choose to look for files whose names started with " bar".
Diffstat (limited to 'lib/libedit')
-rw-r--r--lib/libedit/filecomplete.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c
index 1bb978197eb..7f8e5c369f8 100644
--- a/lib/libedit/filecomplete.c
+++ b/lib/libedit/filecomplete.c
@@ -1,4 +1,4 @@
-/* $NetBSD: filecomplete.c,v 1.62 2019/12/10 19:42:09 christos Exp $ */
+/* $NetBSD: filecomplete.c,v 1.63 2020/01/05 00:03:27 tih Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.62 2019/12/10 19:42:09 christos Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.63 2020/01/05 00:03:27 tih Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -611,12 +611,8 @@ find_word_to_complete(const wchar_t * cursor, const wchar_t * buffer,
if (ctemp - buffer >= 2 && ctemp[-2] == '\\') {
ctemp -= 2;
continue;
- } else if (ctemp - buffer >= 2 &&
- (ctemp[-2] == '\'' || ctemp[-2] == '"')) {
- ctemp--;
- continue;
- } else
- break;
+ }
+ break;
}
if (special_prefixes && wcschr(special_prefixes, ctemp[-1]))
break;