Blob Blame History Raw
From 619fc5790690dc8e0b5b955f7ffb2cd0d0e3626f Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Wed, 26 Aug 2015 07:57:17 +0000
Subject: [PATCH 1/2] don't quote the expanded by completion name otherwise "echo
 $vers<tab><return>" prints Illegal variable name.

---
 tw.parse.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tw.parse.c b/tw.parse.c
index 94982d6..e506e8d 100644
--- a/tw.parse.c
+++ b/tw.parse.c
@@ -1332,7 +1332,6 @@ tw_fixword(int looking, struct Strbuf *word, Char *dir, Char *exp_name)
 	break;
     }
 
-    (void) quote(exp_name);
     Strbuf_append(word, exp_name);		/* add extended name */
     Strbuf_terminate(word);
 } /* end tw_fixword */
-- 
2.5.5

From 6988dbc74d5c5ebed0bd8378793f9315dd8f7651 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Fri, 16 Oct 2015 14:59:56 +0000
Subject: [PATCH 2/2] Fix quoting problem with tab completing a file with a
 space not having a backslash inserted. Revert previous fix and fix the real
 bug in the quoting invalid byte check.

---
 tw.parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tw.parse.c b/tw.parse.c
index e506e8d..affcf55 100644
--- a/tw.parse.c
+++ b/tw.parse.c
@@ -621,9 +621,8 @@ insert_meta(const Char *cp, const Char *cpend, const Char *word,
 #if INVALID_BYTE != 0
 	/* add checking INVALID_BYTE for FIX UTF32 */
 	if ((w & INVALID_BYTE) != INVALID_BYTE)		/* w < INVALID_BYTE */
-#else
-	    w &= ~QUOTE;
 #endif
+	    w &= ~QUOTE;
 
 	if (cmap(w, _ESC | _QF))
 	    wq = QUOTE;		/* quotes are always quoted */
@@ -1332,6 +1331,7 @@ tw_fixword(int looking, struct Strbuf *word, Char *dir, Char *exp_name)
 	break;
     }
 
+    (void) quote(exp_name);
     Strbuf_append(word, exp_name);		/* add extended name */
     Strbuf_terminate(word);
 } /* end tw_fixword */
-- 
2.5.5