GNU bug report logs -
#11608
24.0.94; `shell-resync-dirs' fails if a directory name from the directory stack contains a space
Previous Next
Reported by: Oleksandr Manzyuk <manzyuk <at> gmail.com>
Date: Sat, 2 Jun 2012 15:59:01 UTC
Severity: minor
Tags: confirmed, fixed, patch
Merged with 9379,
23324,
23326
Found in versions 24.0.50, 24.0.94
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #7 received at control <at> debbugs.gnu.org (full text, mbox):
forcemerge 23324 11608 9379
quit
Noah Friedman <friedman <at> splode.com> writes:
> I have a fix for this, but I'd like for someone else to look over it and
> perhaps sanity check it before I commit it. Volunteers?
> This is a very old limitation.
By now this is a fairly old patch, but still in need of review it seems.
> + (let* ((dls (buffer-substring-no-properties (match-beginning 0) (1- (match-end 0))))
> + (dlsl '())
> + (pos 0)
> + (ds '()))
> + ;; Split the dirlist into whitespace and non-whitespace chunks.
> + ;; dlsl will be a reversed list of tokens.
> + (while (string-match "\\(\\S-+\\|\\s-+\\)" dls pos)
> + (push (match-string 1 dls) dlsl)
> + (setq pos (match-end 1)))
> +
> + ;; prepend trailing entries until they form an existing directory,
> + ;; whitespace and all. discard the next whitespace and repeat.
I think this loop is going in the wrong direction (i.e., it should
rather be appending leading entries). Because of this, it can be fooled
by subdirectories with a name matching a substring of a dirs entry:
~$ mkdir -p 'foo bar/bar/'
~$ cd 'foo bar/'
~/foo bar$ command dirs # M-x dirs
# infloops...
> + (let ((newelt "")
> + tem1 tem2)
I'm also not a fan of the somewhat inscrutable tem1 & tem2 names.
This bug report was last modified 4 years and 274 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.