1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-18 21:14:11 +01:00
Commit Graph

4593 Commits

Author SHA1 Message Date
Clint Adams
d71fbc9c69 22165: change "zshparams" to "zshparam". 2006-01-18 03:37:41 +00:00
Wayne Davison
c7ca55dfae Fixed a couple free()-related bugs in the %D prompt-expansion code. 2006-01-17 22:15:28 +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
Bart Schaefer
434ff125f0 22110: more intelligent su completion 2006-01-16 16:32:43 +00:00
Wayne Davison
c5be35fa46 Removed a compiler warning. 2006-01-13 17:49:25 +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
d0502922f9 Remove superfluous STOUC() use. 2006-01-13 17:17:26 +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
fb658381f9 22162 2006-01-13 09:51:58 +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
Clint Adams
e066375d01 22159: completion for tpb. 2006-01-13 01:01:28 +00:00
Wayne Davison
3d7de1c84c Added missing "Src/" prefixes to a recent list of changed files. 2006-01-12 08:45:13 +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
Clint Adams
0d81c253cc 22153: completion for tpconfig. 2006-01-12 02:43:01 +00:00
Wayne Davison
51296c6b81 Even more multibyte code cleanup. 2006-01-12 01:06:03 +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
5af164ea1f A few more mbrtowc() cleanups. 2006-01-11 20:49:11 +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
d09c286871 Minor mbrtowc() changes. 2006-01-09 18:04:46 +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
223ade988b Mention unposted changes to various bits of mbrtowc() code. 2006-01-09 00:52:28 +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
c7c713939d Mention configure.ac changes. 2006-01-08 23:13:53 +00:00
Wayne Davison
8e1306c5b1 Got rid of check for wcswidth() and added my missing commit that
added checks for fchown() and fchmod().
2006-01-08 23:08:39 +00:00
Wayne Davison
08494aa570 An improved version of the patch from 22140. 2006-01-08 22:59:13 +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
37c458aa8c Got rid of our use of wcswidth(). 2006-01-08 22:42:07 +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
e377b38ebf typo in AE and OE ligatures 2006-01-08 18:32:04 +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