From 0f4c32138087a56fd554fd619939fb19d2acbafd Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 20 May 2009 09:53:13 +0000 Subject: 26975: compilation issues in bin_print() --- ChangeLog | 4 +++- Src/builtin.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f30f025fb..3cd2912ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-05-20 Peter Stephenson + * 26975: Src/builtin.c: compilation issues in bin_print(). + * users/14143 plus extra fix in padding code: Doc/Zsh/params.yo, Src/subst.c, Src/utils.c: use default IFS if IFS is unset. @@ -11738,5 +11740,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4691 $ +* $Revision: 1.4692 $ ***************************************************** diff --git a/Src/builtin.c b/Src/builtin.c index 86bb3bb9c..60e81caa4 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3741,6 +3741,10 @@ bin_print(char *name, char **args, Options ops, int func) memset(&mbs, 0, sizeof(mbstate_t)); while (l > 0) { + wchar_t wc; + size_t cnt; + int wcw; + /* * Prevent misaligned columns due to escape sequences by * skipping over them. Octals \033 and \233 are the @@ -3752,15 +3756,16 @@ bin_print(char *name, char **args, Options ops, int func) * out). */ if (*aptr == '\033' || *aptr == '\233') { - for (aptr++, l--; l && !isalpha(*aptr); aptr++, l--); + for (aptr++, l--; + l && !isalpha(STOUC(*aptr)); + aptr++, l--) + ; aptr++; l--; continue; } - wchar_t wc; - size_t cnt = mbrtowc(&wc, aptr, l, &mbs); - int wcw; + cnt = mbrtowc(&wc, aptr, l, &mbs); if (cnt == MB_INCOMPLETE || cnt == MB_INVALID) { -- cgit 1.4.1