bug-bash
[Top][All Lists]
Advanced

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

[PATCH] wrong backtick escaping on autocomplete


From: Igor Bogomazov
Subject: [PATCH] wrong backtick escaping on autocomplete
Date: Mon, 11 May 2015 22:02:15 +0300

in devel branch backticks are not escaped in multibyte character locale

this patch fixes that and the previously reported issue

for devel branch
---
 bashline.c         | 6 ------
 include/shmbchar.h | 1 +
 lib/sh/shmbchar.c  | 2 +-
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/bashline.c b/bashline.c
index f81103a..dcdf40f 100644
--- a/bashline.c
+++ b/bashline.c
@@ -3185,12 +3185,6 @@ bash_directory_completion_hook (dirname)
     }
   else if (local_dirname[0] == '~')
     should_expand_dirname = '~';
-  else
-    {
-      t = mbschr (local_dirname, '`');
-      if (t && unclosed_pair (local_dirname, strlen (local_dirname), "`") == 0)
-       should_expand_dirname = '`';
-    }
 
 #if defined (HAVE_LSTAT)
   if (should_expand_dirname && lstat (local_dirname, &sb) == 0)
diff --git a/include/shmbchar.h b/include/shmbchar.h
index a475f56..f951fdb 100644
--- a/include/shmbchar.h
+++ b/include/shmbchar.h
@@ -335,6 +335,7 @@ is_basic (char c)
     case 'U': case 'V': case 'W': case 'X': case 'Y':
     case 'Z':
     case '[': case '\\': case ']': case '^': case '_':
+    case '`':
     case 'a': case 'b': case 'c': case 'd': case 'e':
     case 'f': case 'g': case 'h': case 'i': case 'j':
     case 'k': case 'l': case 'm': case 'n': case 'o':
diff --git a/lib/sh/shmbchar.c b/lib/sh/shmbchar.c
index 042c9f1..8134048 100644
--- a/lib/sh/shmbchar.c
+++ b/lib/sh/shmbchar.c
@@ -31,7 +31,7 @@ const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
   0x00001a00,           /* '\t' '\v' '\f' */
   0xffffffef,           /* ' '...'#' '%'...'?' */
   0xfffffffe,           /* 'A'...'Z' '[' '\\' ']' '^' '_' */
-  0x7ffffffe            /* 'a'...'z' '{' '|' '}' '~' */
+  0x7fffffff            /* '`' 'a'...'z' '{' '|' '}' '~' */
   /* The remaining bits are 0.  */
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]