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

Pattern change



I'm about to commit the change suggested by Bart that treats the test string for
pattern matching by length instead of assuming null termination.  It doesn't seem
worth posting the patch since it changes large chunks of the file.  There's a new test
in D02glob.ztst for more complicated exclusion patterns involving paths, since
these are specially handled.  All tests still pass.

Potentially this could mean we could unmetafy the string before attempting to match,
which would have advantages.  However, this only makes sense if the pattern itself
uses  unmetafied strings, and that's quite tricky.

Pattern matching still uses memory allocation internally in two places.  First, it
uses it to copy in the start of the path for ~-exclusion.  This can probably be
moved further up by using appropriate flags.  Second, it uses it to avoid pathological
behaviour involving exclusions inside closures; without recording previous endpoints
of matches this can become exponentially slow.  It's possible this can be improved, too,
however.

pws



-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm



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