On Sat, Oct 29, 2005 at 10:59:00AM +0100, Peter Stephenson wrote: > you will need to be careful since those "int" definitions for the > variables now marked as ZLE_CHAR_T have been around a very long time > and it's not necessarily clear if they will hold an EOF or not, though > if they do they should certainly now be ZLE_INT_T. I looked at all the ZLE_CHAR_T variables while making my patch in order to check for size differences (which is why a couple spots got changed to use ZLE_INT_T). One other potential problem area is less-than and greater-than comparisons of character values now that the char may be signed. I just looked through the code to check for problems, and while I didn't see any bugs, I did see a couple things that could be improved (such as using idigit() instead of doing a range-comparison between '0' & '9'). Yet another potential problem area is calling functions such as islower() with a signed character. I looked through the code, and found quite a few problems not related to my patch, including the calling of some non-wide isTYPE() functions on wide characters in the zleline array. Another thing I noticed was that the wide version of ZC_iblank() was calling iswspace(), which would return true for a newline, unlike the normal iblank(), which does not (that is reserved for inblank()). So, attached is a patch that fixes the problems I discovered: I decided to add some new iTYPE() macros, namely iascii(), ilower(), iprint(), and iupper(). I didn't modify inittyptab() to try to define these values (for a number of reasons). Instead, they ensure that STOUC() gets called on the arg before we call the system's version of these functions (aside: we could switch some of the existing macros over to this method, such as idigit(), and free up some bits in the typtab[] array). I also added any missing ZC_iTYPE macros in zle.h, just so they'd all be there. The wide-char version of ZC_iblank now calls a new function, wcsiblank(), that properly excludes '\n' from returning true. However, both ZC_iblank and ZC_inblank still make use of iswspace(), so they return true for a carriage return ('\r') and a vertical tab ('\v') where iblank and inblank do not. I didn't try to change that one way or the other. Comments welcomed. ..wayne..