GNU bug report logs - #3230
dired-actual-switches is risky

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Wed, 6 May 2009 14:25:06 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 3230 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 3230 <at> debbugs.gnu.org
Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable?
Date: Thu, 24 Feb 2011 14:51:16 +0800
On 2011-02-24 12:46 +0800, Leo wrote:
> (defun dired-actual-switches-p (switches)
>   (assert (stringp switches))
>   (mapc
>    (lambda (switch)
>      (assert (eq (aref switch 0) ?-)))
>    (split-string switches nil t)))

Sorry, it should not err. I originally named the function
dired-check-switches, then changed it to be a predicate in the last
minute.

(defun dired-actual-switches-p (switches)
  (and (stringp switches)
       (catch 'exit
         (mapc (lambda (switch)
                 (unless (eq (aref switch 0) ?-)
                   (throw 'exit nil)))
               (split-string switches nil t))
         t)))

Leo




This bug report was last modified 14 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.