Module Name: src Committed By: christos Date: Sun Mar 28 13:39:39 UTC 2021
Modified Files: src/lib/libedit: filecomplete.c Log Message: Only unescape when we are quoting and don't add a space if we are quoting (we already did) (Piotr Stefaniak) To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 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.66 src/lib/libedit/filecomplete.c:1.67 --- src/lib/libedit/filecomplete.c:1.66 Sun Mar 28 09:33:54 2021 +++ src/lib/libedit/filecomplete.c Sun Mar 28 09:39:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.66 2021/03/28 13:33:54 christos Exp $ */ +/* $NetBSD: filecomplete.c,v 1.67 2021/03/28 13:39:39 christos 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.66 2021/03/28 13:33:54 christos Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.67 2021/03/28 13:39:39 christos Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -667,7 +667,7 @@ fn_complete2(EditLine *el, size_t len; int what_to_do = '\t'; int retval = CC_NORM; - int do_unescape = attempted_completion_function == NULL? 1: 0; + int do_unescape = flags & FN_QUOTE_MATCH; if (el->el_state.lastcmd == el->el_state.thiscmd) what_to_do = '?'; @@ -736,7 +736,9 @@ fn_complete2(EditLine *el, el_winsertstr(el, ct_decode_string(completion, &el->el_scratch)); - if (single_match && attempted_completion_function) { + if (single_match && attempted_completion_function && + !(flags & FN_QUOTE_MATCH)) + { /* * We found an exact match. Add a space after * it, unless we do filename completion and the