--- zsh-3.1.9/Src/prompt.c Fri Mar 24 13:43:21 2000 +++ zsh-3.1.9.new/Src/prompt.c Fri Jul 7 17:36:54 2000 @@ -93,6 +93,10 @@ static int dontcount; +/* Backward truncating flag */ + +static int bw; + /* Strings to use for %r and %R (for the spelling prompt). */ static char *rstring, *Rstring; @@ -112,7 +116,8 @@ modp = tricat("~", nd->nam, p + strlen(nd->dir)); if (npath) { - char *sptr; + char *sptr; + if (!bw) { for (sptr = modp + strlen(modp); sptr > modp; sptr--) { if (*sptr == '/' && !--npath) { sptr++; @@ -122,6 +127,15 @@ if (*sptr == '/' && sptr[1] && sptr != modp) sptr++; stradd(sptr); + } else { + char cbu; + for (sptr = modp+1; *sptr; sptr++ ) + if (*sptr == '/' && !--npath) break; + cbu=*sptr; + *sptr=0; + stradd(modp); + *sptr=cbu; + } } else stradd(modp); @@ -197,14 +211,16 @@ Nameddir nd; for (; *fm && *fm != endchar; fm++) { - arg = 0; + arg = bw = 0; if (*fm == '%' && isset(PROMPTPERCENT)) { + if (fm[1]=='0') bw=1; if (idigit(*++fm)) { arg = zstrtol(fm, &fm, 10); } if (*fm == '(') { int tc, otrunclen; + if (fm[1]=='0') bw=1; if (idigit(*++fm)) { arg = zstrtol(fm, &fm, 10); }