bug-bash
[Top][All Lists]
Advanced

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

[PATCH]fix get_history_event in multibytes locale


From: lepton
Subject: [PATCH]fix get_history_event in multibytes locale
Date: Mon, 24 Apr 2006 16:38:04 +0800
User-agent: Mutt/1.5.9i

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I../bash -I../bash/include 
-I../bash/lib  -g -O2
uname output: Linux gsy2.lepton.home 2.6.13.1-skas3-v8.2 #4 Sat Mar 11 19:11:58 
CST 2006 i686 GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        In a multibytes locale like zh_CN, word designators won't work.

Repeat-By:
        export LC_ALL=C
        !cp:p
        This will print the content of last cp command.
        But:
        export LC_ALL=zh_CN
        !cp:p
        This will tell command "cp:p" not found.

Fix:
        The following patch should fix it.
diff -pru bash-2.05b/lib/readline/histexpand.c 
bash-2.05b-lepton/lib/readline/histexpand.c
--- bash-2.05b/lib/readline/histexpand.c        2002-04-16 23:47:59.000000000 
+0800
+++ bash-2.05b-lepton/lib/readline/histexpand.c 2006-04-24 16:21:52.000000000 
+0800
@@ -217,15 +217,17 @@ get_history_event (string, caller_index,
            i += v - 1;
            continue;
          }
-      }
-    else
+       else 
 #endif /* HANDLE_MULTIBYTE */
-      if ((!substring_okay && (whitespace (c) || c == ':' ||
+         if ((!substring_okay && (whitespace (c) || c == ':' ||
          (history_search_delimiter_chars && member (c, 
history_search_delimiter_chars)) ||
          string[i] == delimiting_quote)) ||
          string[i] == '\n' ||
          (substring_okay && string[i] == '?'))
-       break;
+           break;
+#if defined (HANDLE_MULTIBYTE)
+       }
+#endif
 
   which = i - local_index;
   temp = (char *)xmalloc (1 + which);




reply via email to

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