mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
zsh-workers/9296
This commit is contained in:
parent
bfd6782b5a
commit
13c09ff02f
1 changed files with 8 additions and 5 deletions
|
@ -436,7 +436,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
int sfx, int test, int part)
|
int sfx, int test, int part)
|
||||||
{
|
{
|
||||||
int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw;
|
int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw;
|
||||||
int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc;
|
int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc, bslash;
|
||||||
VARARR(unsigned char, ea, ll + 1);
|
VARARR(unsigned char, ea, ll + 1);
|
||||||
char *ow;
|
char *ow;
|
||||||
Cmlist ms;
|
Cmlist ms;
|
||||||
|
@ -736,12 +736,15 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
if (mp)
|
if (mp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (l[ind] == w[ind]) {
|
bslash = 0;
|
||||||
|
if (l[ind] == w[ind] ||
|
||||||
|
(bslash = (lw > 1 && w[ind] == '\\' &&
|
||||||
|
(ind ? (w[0] == l[0]) : (w[1] == l[0]))))) {
|
||||||
/* No matcher could be used, but the strings have the same
|
/* No matcher could be used, but the strings have the same
|
||||||
* character here, skip over it. */
|
* character here, skip over it. */
|
||||||
l += add; w += add;
|
l += add; w += (bslash ? (add + add ) : add);
|
||||||
il++; iw++;
|
il++; iw += 1 + bslash;
|
||||||
ll--; lw--;
|
ll--; lw -= 1 + bslash;
|
||||||
bc++;
|
bc++;
|
||||||
if (!test)
|
if (!test)
|
||||||
while (bp && bc >= (useqbr ? bp->qpos : bp->pos)) {
|
while (bp && bc >= (useqbr ? bp->qpos : bp->pos)) {
|
||||||
|
|
Loading…
Reference in a new issue