summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-18 13:57:25 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-18 13:57:25 +0000
commitd7c13fb2c3b1b014acde9c1cb17a1e34239b9751 (patch)
tree7b31d7d08233e1cc1b1ab46af1ac44b25ed4f2c1 /Src/Zle/zle_tricky.c
parent294ef9e87237bf1dc12b17a26bc4b22aa5604282 (diff)
downloadzsh-d7c13fb2c3b1b014acde9c1cb17a1e34239b9751.tar.gz
zsh-d7c13fb2c3b1b014acde9c1cb17a1e34239b9751.tar.xz
zsh-d7c13fb2c3b1b014acde9c1cb17a1e34239b9751.zip
20822: Initial code for Unicode/multibyte input
20823: Debugging test in stat wrong for 64-bit systems
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index a4d87dfea..15c723d7a 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2298,12 +2298,27 @@ doexpandhist(void)
 }
 
 /**/
+void
+fixmagicspace(void)
+{
+    lastchar = ' ';
+#ifdef ZLE_UNICODE_SUPPORT
+    /*
+     * This is redundant if the multibyte encoding extends ASCII,
+     * since lastchar is a full character, but it's safer anyway...
+     */
+    lastchar_wide = L' ';
+    lastchar_wide_valid = TRUE;
+#endif
+}
+
+/**/
 int
 magicspace(char **args)
 {
     char *bangq;
     int ret;
-    lastchar = ' ';
+    fixmagicspace();
     for (bangq = (char *)zleline; (bangq = strchr(bangq, bangchar));
 	 bangq += 2)
 	if (bangq[1] == '"' && (bangq == (char *)zleline || bangq[-1] != '\\'))