Module Name:    src
Committed By:   tih
Date:           Sun Jan  5 00:03:28 UTC 2020

Modified Files:
        src/lib/libedit: filecomplete.c

Log Message:
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".


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/libedit/filecomplete.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/filecomplete.c
diff -u src/lib/libedit/filecomplete.c:1.62 src/lib/libedit/filecomplete.c:1.63
--- src/lib/libedit/filecomplete.c:1.62	Tue Dec 10 19:42:09 2019
+++ src/lib/libedit/filecomplete.c	Sun Jan  5 00:03:27 2020
@@ -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 * cu
 			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;

Reply via email to