From 85c513894d42293c79b46f09a039162329698656 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 15 Nov 2008 21:27:45 +0000 Subject: 26047: convert lower levels of completion matching to use multibyte strings and wide characters --- Src/pattern.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Src/pattern.c') 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 -- cgit 1.4.1