1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00
Commit graph

1465 commits

Author SHA1 Message Date
Wayne Davison
542797377a - When mbrtowc() returns -2 when given all the remaining chars in a
string, set an end-of-line flag and avoid calling mbrtowc() again
  for any of the incomplete characters that remain in the string.
- Use "mbs" for the multi-byte state variable name (for consistency).
- Use the new MB_INVALID and MB_INCOMPLETE defines for the size_t
  -1 and -2 values (respectively).
2006-01-12 00:51:50 +00:00
Wayne Davison
e46d08523f - The return value of mbsrtowcs() is also a size_t (like mbrtowc()).
- When mbrtowc() returns -2 when given all the remaining chars in a
  string, set an end-of-line flag and avoid calling mbrtowc() again
  for any of the incomplete characters that remain in the string.
- Use "mbs" for the multi-byte state variable name (for consistency).
- Use the new MB_INVALID and MB_INCOMPLETE defines for the size_t
  -1 and -2 values (respectively).
2006-01-12 00:51:44 +00:00
Wayne Davison
eebfabe548 - The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check for negativity, as that won't
  work on a system where an int is larger than a size_t.
- When mbrtowc() returns -2 when given all the remaining chars in a
  string, set an end-of-line flag and avoid calling mbrtowc() again
  for any of the incomplete characters that remain in the string.
- Use STOUC() when passing a char value to nicechar().
- Use "mbs" for the multi-byte state variable name (for consistency).
- Be sure to reset the mbs state if mbrtowc() returns -1.
- Use the new MB_INVALID and MB_INCOMPLETE defines for the size_t
  -1 and -2 values (respectively).
2006-01-12 00:51:41 +00:00
Wayne Davison
3039f65d74 Define MB_INCOMPLETE and MB_INVALID for MULTIBYTE_SUPPORT. 2006-01-12 00:51:38 +00:00
Wayne Davison
4b831f02df Tweaked the code to handle mbrtowc() converting '\0' the same way as
the other callers do.  Also, changed the variable name to 'cnt'.
2006-01-11 20:12:09 +00:00
Wayne Davison
4c3edda1f1 Decided to use a switch() in mb_niceformat(). 2006-01-11 20:09:03 +00:00
Wayne Davison
23bd860ef7 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's <= 0, as that won't
work on a system where an int is larger than a size_t.
2006-01-11 20:01:27 +00:00
Wayne Davison
c6798bc151 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's >= 0, as that won't
work on a system where an int is larger than a size_t.
2006-01-11 19:49:59 +00:00
Wayne Davison
4ffa433443 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's < 0, as that won't
work on a system where an int is larger than a size_t.
2006-01-11 19:42:40 +00:00
Peter Stephenson
fa633171fd 22151: bug outputting here-strings from which etc. when already quoted 2006-01-10 16:57:02 +00:00
Wayne Davison
00465c76fb Changed the name of the "ret" variable in mb_niceformat() to "cnt"
because "ret" is usually used for a variable name to hold the
return value of the function.  Also, changed the test when
checking for a \0 to only check if "cnt" is 0, since we must
always change a value of 0 to 1.
2006-01-09 17:58:57 +00:00
Wayne Davison
cc890edcb5 Changed the name of the "ret" variable in mb_niceformat() to "cnt"
because "ret" is usually used for a variable name to hold the
return value of the function.  Also, changed the test when
checking for a \0 to one that checks if "cnt" is 0, since we
must always change a value of 0 to 1.
2006-01-09 17:44:02 +00:00
Wayne Davison
90f7b1e173 A test for (size_t)-1 needed to check for (size_t)-2 too. 2006-01-09 17:39:44 +00:00
Wayne Davison
5750513c00 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's < 0, as that won't
work on a system where an int is larger than a size_t.  Also,
the code that handled partial multibyte characters (that were
assembled from multiple bytes of a metafied string) was not
advancing past all the assembled bytes, nor was it handling the
decoding of a '\0' char (it looks like it could have infinite
looped in that case).
2006-01-09 01:09:55 +00:00
Wayne Davison
791bbf7120 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's > 0, as that won't
work on a system where an int is larger than a size_t.  Also,
we needed to use STOUC() on a char value passed to nicechar(),
and we need to clear the mbstate_t object if mbrtowc() returns
an error.
2006-01-09 00:37:10 +00:00
Wayne Davison
74b4973888 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's > 0, as that won't
work on a system where an int is larger than a size_t.  Also,
we needed to use STOUC() on a char value passed to nicechar().
2006-01-09 00:29:57 +00:00
Wayne Davison
9cf3f9ad71 The return value of mbrtowc() is a size_t (unsigned), so don't
assign it to an int and then check if it's > 0, as that won't
work on a system where an int is larger than a size_t.
2006-01-09 00:17:24 +00:00
Wayne Davison
97c34b631c Changed mb_niceformat() so that it does not truncate a name that
has an invalid character sequence in the current character set,
displaying them as \M-... chars.  (Improved version of the patch
from workers/22140.)
2006-01-08 22:57:05 +00:00
Wayne Davison
2150c0f09b Got rid of wcswidth() define for OpenBSD now that wcswidth() isn't
used.
2006-01-08 22:37:15 +00:00
Wayne Davison
2367a62e4c Changed wcswidth(&c, 1) to wcwidth(c). 2006-01-08 22:36:08 +00:00
Peter Stephenson
94953f70b9 22124: handle bad multibyte input better 2006-01-06 14:23:00 +00:00
Peter Stephenson
d8a851a9a8 22123: probe for wcswidth() and assume 1 if not found 2006-01-06 11:41:47 +00:00
Peter Stephenson
7a389a2fc3 22082: print out uid or gid in stat if name not available 2005-12-19 11:35:40 +00:00
Wayne Davison
78168105de Two changes in the HIST_SAVE_BY_COPY code: (1) preserve the group
and permissions on the history file, and (2) fail if zsh's euid
differs from the file's uid (since that would change the history
file's owner).
2005-12-17 07:58:12 +00:00
Peter Stephenson
f7037211ad 22085 and back off 22075: include langinfo.h to get iconv 2005-12-15 14:51:39 +00:00
Peter Stephenson
b5a83cc754 users/9788: add (oN) glob qualifier for no sorting
22076: more documentation for multibyte handling
2005-12-15 10:38:55 +00:00
Bart Schaefer
174ad4a80f 21814: error handling for traps in "always" constructs. 2005-12-15 04:24:04 +00:00
Wayne Davison
3cb9df7bc7 Changed ucs4toutf8() into a static function (since it's only
used by this file when it's even defined).
2005-12-14 23:10:12 +00:00
Peter Stephenson
12f20954e9 22075: assume we can convert characters with wctomb() with --enable-multibyte 2005-12-14 18:28:53 +00:00
Wayne Davison
a2e7cbe308 A slightly more optimal way to fix the zle_setline() bug using
the same zlecs-checking idiom as setline().
2005-12-12 18:35:47 +00:00
Wayne Davison
e0c9faba4d Fixed problem in zle_setline() where moving to an empty line would
set zlecs to -1. (Reported by Jun T.)
2005-12-12 18:22:08 +00:00
Peter Stephenson
00e0c063ac 22069: completion listings didn't get unmetafied 2005-12-10 21:04:42 +00:00
Wayne Davison
ec2ad9dd8b Just-added "return" should have returned a value. 2005-12-10 00:27:11 +00:00
Peter Stephenson
405fd07656 22057: don't use zsh/newuser in emulation
22058: tweak docs for release
2005-12-09 12:49:29 +00:00
Peter Stephenson
bf3ee0f725 22049: bug exiting from sourced file within function 2005-12-03 00:14:05 +00:00
Wayne Davison
37e08571a4 Fixed parsedigit() to have it use its arg instead of "lastchar". 2005-11-30 16:49:44 +00:00
Wayne Davison
9483fd8a14 One more fix for the non-multibyte prototype generation. 2005-11-30 16:35:33 +00:00
Geoff Wing
fac5d69b8b fix utils.c prototype generation for non multibyte build 2005-11-29 01:43:14 +00:00
Peter Stephenson
3403c59af2 22027: more zsh-newuser-install fixes
22028: WARN_CREATE_GLOBAL overeager with temporarily set variables
2005-11-25 10:36:19 +00:00
Peter Stephenson
e66af50a98 22014: argument-base, insert-unicode-char 2005-11-24 10:25:33 +00:00
Peter Stephenson
09a854378a 22009: another double-width character fix 2005-11-21 15:22:12 +00:00
Wayne Davison
63cf1412f2 Got rid of two unneeded "(char *)" casts. 2005-11-18 17:26:10 +00:00
Wayne Davison
2288d7760b Got rid of some compiler warnings about comparisons between signed
and unsigned variables.
2005-11-15 09:34:00 +00:00
Wayne Davison
c70dabb500 Changed zlelineasstring() and zlegetline() to each return a normal char
pointer, not an unsigned char pointer.  Changed stringaszleline() to
take a normal char pointer for its first arg.  Got rid of some
unsigned-char/char pointer casts.
2005-11-15 08:44:32 +00:00
Wayne Davison
de79438241 Changed zlemetaline into a normal char pointer, not unsigned char.
Got rid of some unsigned-char/char pointer casts.
2005-11-15 08:44:30 +00:00
Wayne Davison
62c71d5d50 Changed zleread() to return a normal char pointer, not unsigned char.
Got rid of some unsigned-char/char pointer casts.
2005-11-15 08:44:28 +00:00
Wayne Davison
0f0d610401 The non-multibyte version of ZWS() doesn't need to force a cast anymore. 2005-11-15 08:44:26 +00:00
Wayne Davison
01875dc4a1 Changed ztrcmp() to take normal char pointers, not unsigned char. 2005-11-15 08:44:24 +00:00
Wayne Davison
d8838293f5 Changed two zle functions to each return a char pointer, not an
unsigned char pointer.
2005-11-15 08:44:21 +00:00
Wayne Davison
e79af955f0 Got rid of some unsigned-char/char pointer casts. 2005-11-15 08:44:17 +00:00