From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: Re: Long directories in prompt
Date: Tue, 31 Dec 1996 12:50:10 +0000 (GMT) [thread overview]
Message-ID: <29297.199612311250@stone.dcs.warwick.ac.uk> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Zoltan's fix broke prompt truncation.
-zefram
*** Src/prompt.c 1996/12/30 14:14:18 1.2
--- Src/prompt.c 1996/12/30 14:47:46
***************
*** 293,301 ****
switch (*fm) {
case '~':
if ((nd = finddir(pwd))) {
! stradd("~");
! stradd(nd->nam);
! stradd(pwd + strlen(nd->dir));
break;
}
case 'd':
--- 293,301 ----
switch (*fm) {
case '~':
if ((nd = finddir(pwd))) {
! char *t = tricat("~", nd->nam, pwd + strlen(nd->dir));
! stradd(t);
! zsfree(t);
break;
}
case 'd':
***************
*** 308,316 ****
char *t;
if ((nd = finddir(pwd)))
! t = pwd + strlen(nd->dir);
else
! t = pwd;
if (!arg)
arg++;
for (ss = t + strlen(t); ss > t; ss--)
--- 308,316 ----
char *t;
if ((nd = finddir(pwd)))
! t = tricat("~", nd->nam, pwd + strlen(nd->dir));
else
! t = ztrdup(pwd);
if (!arg)
arg++;
for (ss = t + strlen(t); ss > t; ss--)
***************
*** 318,329 ****
ss++;
break;
}
! if (nd && ss == t && (*ss != '/' || arg > 1)) {
! stradd("~");
! stradd(nd->nam);
! } else if (*ss == '/' && ss[1] && (ss != pwd))
ss++;
stradd(ss);
break;
}
case 'C':
--- 318,327 ----
ss++;
break;
}
! if(*ss == '/' && ss[1] && ss != t)
ss++;
stradd(ss);
+ zsfree(t);
break;
}
case 'C':
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBMsfXbnD/+HJTpU/hAQHrdAP+OoJD1x42fqkg47HY1/NjEqbXDsIlpqo/
pVAim1JjUdG70FHBNpMU5+k+r3raC9mki3Tqthj3/taVf95rkpOubLzEEx+4RocG
TSSe/UVnqTHxJdSR62UM63EciL+sximv04EUh0erLz0jJQzQoAwc8sl9uehe9s0W
t3j1JOjaWoQ=
=2/CR
-----END PGP SIGNATURE-----
next reply other threads:[~1996-12-31 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-12-31 12:50 Zefram [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-12-30 3:39 Zoltan Hidvegi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=29297.199612311250@stone.dcs.warwick.ac.uk \
--to=zefram@dcs.warwick.ac.uk \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).