From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Cc: 306346-forwarded@bugs.debian.org
Subject: Re: [mpol@charybda.icm.edu.pl: Bug#306346: zsh: replacement seems broken in prompt]
Date: Tue, 26 Apr 2005 03:49:16 +0000 [thread overview]
Message-ID: <1050426034916.ZM26792@candle.brasslantern.com> (raw)
In-Reply-To: <20050426013716.GA3958@scowler.net>
On Apr 25, 9:37pm, Clint Adams wrote:
} Subject: [mpol@charybda.icm.edu.pl: Bug#306346: zsh: replacement seems bro
}
} This is with 21170.
}
} ----- Forwarded message from Michal Politowski <mpol@charybda.icm.edu.pl> -----
}
} ${${foo}/?*/replacement} puts replacement in the prompt even when foo is empty
Hrm. This seems to be strictly a promptsubst thing, because
schaefer<505> echo ${${foo}/?*/replacement}
schaefer<506> RPS1='${${foo}/?*/replacement}'
schaefer<507> setopt promptsubst ${${foo}/?*/replacement}
schaefer<508> replacement
Ah, here's an easier way to reproduce it:
schaefer<510> echo "${${foo}/?*/replacement}"
replacement
So it's a quoting thing.
According to GDB, both before and after 21170 the inner ${foo} is
resulting in "\233\0" (which is a Nularg). After 21170, however, the
comparison against ?* matches this as one character.
The problem is here at line 2344:
2344 if (pattrylen(p, t, s + l - t, umlen, ioff)) {
And it seems that this is the answer to the question in pattern.c:
/* inherited from domatch, but why, exactly? */
if (*string == Nularg)
string++;
This is precisely the case we're encountering here; it changes the value
of unmetalen within pattryrefs() in a way that we're not changing it
when precomputing it in igetmatch().
What I don't know, though, is whether the Nularg test should be copied
into both igetmatch() and down to by the ztrsub() call in pattryrefs(),
or whether it should simply be
/* inherited from domatch, but why, exactly? */
if (*string == Nularg)
string++, unmetalen--;
next prev parent reply other threads:[~2005-04-26 3:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-26 1:37 Clint Adams
2005-04-26 3:49 ` Bart Schaefer [this message]
2005-04-26 9:44 ` Peter Stephenson
2005-04-26 16:14 ` Bart Schaefer
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=1050426034916.ZM26792@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=306346-forwarded@bugs.debian.org \
--cc=zsh-workers@sunsite.dk \
/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).