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

Re: segfault with exceedingly long path



On Feb 24,  3:38pm, Oliver Kiddle wrote:
}
} So if the directory starts as / the !*xbuf test succeeds and it prints
} the warning. I'm not sure whether it would be better to skip the whole
} xsymlinks call for a path of "/" or to check the return status from it.

Hrm.  xsymlinks() is meant to return 1 when there was a symbolic link
followed, but it is also responsible for collapsing out "../" so in
xsymlink() the return value doesn't tell us whether the input and
output paths should be the same.  Also:

torch% cd /tmp/../
zsh: path expansion failed, using root directory
torch% ln -s / /tmp/root
torch% cd /tmp/root
zsh: path expansion failed, using root directory

So neither checking the return value nor skipping xsymlinks() for "/"
will work, we actually have to differentiate paths that resolve to the
root from paths that fail to resolve.

This is going to require more analysis of xsymlinks() than I have time
to do today (possibly more than I have time to do this week).



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