mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
21890: fix segmentation error in left prompt truncation and a couple of minor
inconsistencies
This commit is contained in:
parent
26e60b1f3a
commit
2ddaeb605f
4 changed files with 12 additions and 6 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
2005-10-19 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
2005-10-19 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 21890: Src/builtin.c, Src/prompt.c, Src/zle_utils.c: allocation
|
||||||
|
inconsistencies in print builtin, segmentation error with
|
||||||
|
left prompt truncation from 21882, warning about variable
|
||||||
|
signedness in zle_utils.c.
|
||||||
|
|
||||||
* 21887: Src/Zle/zle_refresh.c: attempt to display wide characters
|
* 21887: Src/Zle/zle_refresh.c: attempt to display wide characters
|
||||||
wider than one screen cell properly.
|
wider than one screen cell properly.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -787,7 +787,8 @@ showmsg(char const *msg)
|
||||||
ZLE_CHAR_T c;
|
ZLE_CHAR_T c;
|
||||||
#ifdef ZLE_UNICODE_SUPPORT
|
#ifdef ZLE_UNICODE_SUPPORT
|
||||||
char *umsg;
|
char *umsg;
|
||||||
int ulen, ret, width;
|
int ulen, ret;
|
||||||
|
size_t width;
|
||||||
mbstate_t ps;
|
mbstate_t ps;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3368,7 +3368,7 @@ bin_print(char *name, char **args, Options ops, int func)
|
||||||
*/
|
*/
|
||||||
char *str = unmetafy(promptexpand(metafy(args[n], len[n],
|
char *str = unmetafy(promptexpand(metafy(args[n], len[n],
|
||||||
META_NOALLOC), 0, NULL, NULL), &len[n]);
|
META_NOALLOC), 0, NULL, NULL), &len[n]);
|
||||||
args[n] = dupstring(str);
|
args[n] = dupstrpfx(str, len[n]);
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
/* -D option -- interpret as a directory, and use ~ */
|
/* -D option -- interpret as a directory, and use ~ */
|
||||||
|
|
@ -3378,9 +3378,9 @@ bin_print(char *name, char **args, Options ops, int func)
|
||||||
queue_signals();
|
queue_signals();
|
||||||
d = finddir(args[n]);
|
d = finddir(args[n]);
|
||||||
if(d) {
|
if(d) {
|
||||||
char *arg = zhalloc(strlen(args[n]) + 1);
|
int dirlen = strlen(d->dir);
|
||||||
sprintf(arg, "~%s%s", d->nam,
|
char *arg = zhalloc(len[n] - dirlen + strlen(d->nam) + 2);
|
||||||
args[n] + strlen(d->dir));
|
sprintf(arg, "~%s%s", d->nam, args[n] + dirlen);
|
||||||
args[n] = arg;
|
args[n] = arg;
|
||||||
len[n] = strlen(args[n]);
|
len[n] = strlen(args[n]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1078,7 +1078,7 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar)
|
||||||
int remw;
|
int remw;
|
||||||
mbstate_t mbs;
|
mbstate_t mbs;
|
||||||
|
|
||||||
fulltextptr = fulltext = bp;
|
fulltextptr = fulltext = ptr + ntrunc;
|
||||||
memmove(fulltext, ptr, fullen);
|
memmove(fulltext, ptr, fullen);
|
||||||
fulltext[fullen] = '\0';
|
fulltext[fullen] = '\0';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue