emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ in directory name breaks dired


From: Eli Zaretskii
Subject: Re: [ in directory name breaks dired
Date: 22 Oct 2003 08:21:04 +0200

> Date: Wed, 22 Oct 2003 01:14:10 +0200
> From: Chris Moore <address@hidden>
> 
> If a directory name contains a '[' then dired can't list it.

I think the problem is not in dired, it's in ls-lisp.el, so will only
show on non-Posix platforms which use ls-lisp as a replacement for (a
possibly missing) `ls'.

> If the '[' is matched in the name by a following ']' then there's no
> error, but the dired listing is empty (it doesn't even show '.' and
> '..').
> 
> If, on the other hand, the '[' is unmatched, I get a Lisp error.
> Notice that the 3rd argument to 'insert-directory' (wildcard) is nil,
> and yet the argument still gets treated as if it were a wildcard.
> I'm guessing that may be the source of the problem:
> 
>   Debugger entered--Lisp error: (invalid-regexp "Unmatched [ or [^")
> 
>     directory-files-and-attributes("c:/chris/" nil "\\`[x\\'" t)
> 
>     ls-lisp-insert-directory("c:/chris/" (97 108) nil "\\`[x\\'" t)
> 
>     insert-directory("c:/chris/[x/" "-al" nil t)

I'm guessing that somewhere in this chain of calls, we should have
called regexp-quote on the file name.  Could you please look closer at
the code and see where?

TIA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]