Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Summary: Remove over-simplified extraneous test



details:   https://anonhg.NetBSD.org/src/rev/60942af070d2
branches:  trunk
changeset: 968172:60942af070d2
user:      tih <tih%NetBSD.org@localhost>
date:      Sun Jan 05 00:03:27 2020 +0000

description:
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:

 lib/libedit/filecomplete.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r bbf7c979ef50 -r 60942af070d2 lib/libedit/filecomplete.c
--- a/lib/libedit/filecomplete.c        Sat Jan 04 22:49:20 2020 +0000
+++ b/lib/libedit/filecomplete.c        Sun Jan 05 00:03:27 2020 +0000
@@ -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 @@
                        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;



Home | Main Index | Thread Index | Old Index