about summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-11-15 21:27:45 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-11-15 21:27:45 +0000
commit85c513894d42293c79b46f09a039162329698656 (patch)
treee4cb108ebd22c4e7420cb6baf9cf9f59018c29c8 /Src/pattern.c
parentac38534728b2980d1e4b3422453322546b975062 (diff)
downloadzsh-85c513894d42293c79b46f09a039162329698656.tar.gz
zsh-85c513894d42293c79b46f09a039162329698656.tar.xz
zsh-85c513894d42293c79b46f09a039162329698656.zip
26047: convert lower levels of completion matching to use
multibyte strings and wide characters
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 60f70023a..d4941253c 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -3344,7 +3344,6 @@ mb_patmatchrange(char *range, wchar_t ch, wint_t *indptr, int *mtp)
 }
 
 
-#if 0
 /*
  * This is effectively the reverse of mb_patmatchrange().
  * Given a range descriptor of the same form, and an index into it,
@@ -3353,11 +3352,6 @@ mb_patmatchrange(char *range, wchar_t ch, wint_t *indptr, int *mtp)
  * return the type in mtp instead.  Return 1 if successful, 0 if
  * there was no corresponding index.  Note all pointer arguments
  * must be non-null.
- *
- * TODO: for now the completion matching code does not handle
- * multibyte.  When it does, we will need either this, or
- * patmatchindex(), but not both---unlike user-initiated pattern
- * matching, multibyte mode in the line editor is always on when available.
  */
 
 /**/
@@ -3438,10 +3432,9 @@ mb_patmatchindex(char *range, wint_t ind, wint_t *chr, int *mtp)
     /* No corresponding index. */
     return 0;
 }
-#endif
 
 /**/
-#endif
+#endif /* MULTIBYTE_SUPPORT */
 
 /*
  * Identical function to mb_patmatchrange() above for single-byte
@@ -3572,9 +3565,17 @@ patmatchrange(char *range, int ch, int *indptr, int *mtp)
     return 0;
 }
 
+
+/**/
+#ifndef MULTIBYTE_SUPPORT
+
 /*
  * Identical function to mb_patmatchindex() above for single-byte
  * characters.  Here -1 represents a character that needs a special type.
+ *
+ * Unlike patmatchrange, we only need this in ZLE, which always
+ * uses MULTIBYTE_SUPPORT if compiled in; hence we don't use
+ * this function in that case.
  */
 
 /**/
@@ -3658,6 +3659,9 @@ patmatchindex(char *range, int ind, int *chr, int *mtp)
     return 0;
 }
 
+/**/
+#endif /* MULTIBYTE_SUPPORT */
+
 /*
  * Repeatedly match something simple and say how many times.
  * charstart is an array parallel to that starting at patinput