Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zpc_special [was Re: question about glob qualifier format (#qx)]



On Sep 21,  4:35pm, Bart Schaefer wrote:
}
} 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.

Confirmation of this -- if I make sure to evaluate an unqualified pattern
before evaluating each qualified glob, then everything "works":

schaefer[528] Src/zsh -f
torch% print *(#q/)
Config Doc Etc Src Test
torch% print *(#q/)
zsh: unknown file attribute: #
torch% 
schaefer[529] Src/zsh -f
torch% : *
torch% print *(#q/)
zsh: unknown file attribute: #
torch% setopt extendedglob
torch% print *(#q/)       
zsh: unknown file attribute: #
torch% : *
torch% print *(#q/)
Config Doc Etc Src Test
torch% 


(I tweaked the "unknown file attribute" error message to get it to show
what character caused the failure, which I figure is helpful so I've
committed/pushed it as an unposted change.)



Messages sorted by: Reverse Date, Date, Thread, Author