Weed out non-existing directories when loading DIRSTACKFILE
authorFrank Terbeck <ft@grml.org>
Fri, 26 Jun 2015 09:38:33 +0000 (11:38 +0200)
committerFrank Terbeck <ft@grml.org>
Fri, 26 Jun 2015 09:52:52 +0000 (11:52 +0200)
commitef0f2491f306bf6ca59090f9ef68e7f7a8420461
tree550b1b3031c3e9ac65d29dd879a33e92ac18d8fe
parent33bc6db8acfbd3a336056686b69e022f0ea5f8a3
Weed out non-existing directories when loading DIRSTACKFILE

Between saving our persistent dirstack file and loading it in the next
session, directories of which the names we saved might have ceased to
exist. This can cause problems, when the first entry from the saved
dirstack points to a non-existing directory.

Ordinarily, that would not be catastrophic and only lead to an error
message while loading the setup. But if you throw auto-mounters into the
mix, this can cause the setup to hang until the auto-mounter runs into a
timeout.

The proposed fix is to filter out names of non-existing directories
while loading the saved dirstack file.

This leaves the window between loading the file and trying to change to
the first then-existing directory of the file open for the directory to
vanish. That would be tough luck, I guess.

Reported-by: Till Hofmann <hofmanntill@gmail.com>
Signed-off-by: Frank Terbeck <ft@grml.org>
etc/zsh/zshrc