Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zpc_special [was Re: question about glob qualifier format (#qx)]
- X-seq: zsh-workers 31739
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: zpc_special [was Re: question about glob qualifier format (#qx)]
- Date: Sat, 21 Sep 2013 16:35:31 -0700
- In-reply-to: <130921013028.ZM17637@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20130920111110.GA4501@localhost.localdomain> <20130920123830.30111071@pwslap01u.europe.root.pri> <20130920233930.GB4501@localhost.localdomain> <130921013028.ZM17637@torch.brasslantern.com>
On Sep 21, 1:30am, Bart Schaefer wrote:
}
} I accidentally encountered some odd behavior while confirming this.
} With NO_EXTENDED_GLOB, #q is not supposed to be available to introduce
} qualifiers. However
}
} % setopt NO_EXTENDED_GLOB
} % echo *(#q@)
} <list of symlinks>
}
} Whereas
}
} % echo *(#q/)
} zsh: unknown file attribute
}
} This is inconsistent, that is, sometimes (#q@) will also give "unknown"
} and (#q/) will work.
I believe this has to do with the new zpc_special[] array in pattern.c.
The first time we enter zglob(), it has not been initalized yet (?) and
so "#" is believed to be an active pattern chracter even though the
EXTENDED_GLOB option may not be set. The next time through zpc_special
will have been initialized, but it doesn't get re-initialized when the
extendedglob option is toggled (?) so the parsing of "#" may be left in
the wrong state.
Or something along those lines; PWS will have a better idea what is
going on, I hope.
I suspect glob.c:zglob() needs to call pattern.c:patparsecharset() before
it begins parsing the qualifiers, but the latter is static in parse.c, so
it isn't called until zglob() calls parsepat() much later, and I don't
follow the ramifications of calling patparsecharset() more than once for
the same pattern because the whole array gets clobbered and reset on each
call. Maybe harmless, I again hope PWS will have a better idea.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author