1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-17 00:31:09 +02:00
Commit graph

1427 commits

Author SHA1 Message Date
Peter Stephenson
8b0cc87817 22195: don't set HOME in the shell 2006-02-06 11:57:03 +00:00
Peter Stephenson
4b3cdcdb69 22169: hook function zle-keymap-select called when $KEYMAP changes 2006-01-28 15:02:25 +00:00
Wayne Davison
f211604396 Tweaked the code that handles %D so that: (1) we don't free() a NULL
pointer (we use zsfree() instead), and (2) we avoid a rare bug that
could call free() on same memory twice (e.g. "%D{}%D").
2006-01-17 22:14:40 +00:00
Wayne Davison
4817964a07 Got rid of unused-variable compiler warning when compiling a
non-multibyte zsh.
2006-01-13 17:46:09 +00:00
Wayne Davison
78ddb65f6c Got rid of some superfluous STOUC() calls (such as the ones I added
for the arg of calls to nicechar(), which doesn't need this).
2006-01-13 17:13:49 +00:00
Wayne Davison
394a6b3567 A better version of my last change. 2006-01-13 09:43:46 +00:00
Wayne Davison
325c9a1de5 Metafy the output of the ztrftime() string since that's what the
prompt expects and some date names might not be ASCII.
2006-01-13 09:25:09 +00:00
Wayne Davison
39b3d2b90a Values being stored in an array or a hash needed to be metafied
(using META_DUP) instead of just duplicated via ztrdup().
2006-01-13 09:15:59 +00:00
Wayne Davison
7c9c5bff0d If we are saving the ztrftime() value in a variable, we now metafy
the string (using META_DUP) instead of duplicating it via ztrdup().
2006-01-13 09:02:43 +00:00
Wayne Davison
70de60a962 The new "eol" var was being set in singlerefresh(), but not accessed. 2006-01-12 08:33:15 +00:00
Wayne Davison
4867f99ef9 - 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 01:04:17 +00:00
Wayne Davison
f6fefb2db3 - 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:53 +00:00
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