emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103457: Give dired-actual-switches a


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103457: Give dired-actual-switches a safe-local-variable property. (Bug#3230)
Date: Mon, 28 Feb 2011 19:25:24 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103457
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2011-02-28 19:25:24 -0800
message:
  Give dired-actual-switches a safe-local-variable property.  (Bug#3230)
  
  * lisp/dired.el (dired-safe-switches-p): Beef it up.
  (dired-actual-switches): Use it for the safe-local-variable property.
modified:
  lisp/ChangeLog
  lisp/dired.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-01 03:10:11 +0000
+++ b/lisp/ChangeLog    2011-03-01 03:25:24 +0000
@@ -1,3 +1,8 @@
+2011-03-01  Glenn Morris  <address@hidden>
+
+       * dired.el (dired-safe-switches-p): Beef it up.
+       (dired-actual-switches): Use it for the safe-local prop.  (Bug#3230)
+
 2011-03-01  Stefan Monnier  <address@hidden>
 
        * dired.el (dired-safe-switches-p): New function.

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2011-03-01 03:10:11 +0000
+++ b/lisp/dired.el     2011-03-01 03:25:24 +0000
@@ -249,12 +249,19 @@
 directory name and the cdr is the list of files to mention.
 The directory name must be absolute, but need not be fully expanded.")
 
+;; Beware of "-l;reboot" etc.  See bug#3230.
 (defun dired-safe-switches-p (switches)
-  (string-match "\\`[- [:alnum:]]+\\'" switches))
+  "Return non-nil if string SWITCHES does not look risky for dired."
+  (or (not switches)
+      (and (stringp switches)
+           (< (length switches) 100)    ; arbitrary
+           (string-match "\\` *-[- [:alnum:]]+\\'" switches))))
 
 (defvar dired-actual-switches nil
   "The value of `dired-listing-switches' used to make this buffer's text.")
 
+(put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p)
+
 (defvar dired-re-inode-size "[0-9 \t]*"
   "Regexp for optional initial inode and file size as made by `ls -i -s'.")
 
@@ -3617,7 +3624,7 @@
 ;;;;;;  dired-run-shell-command dired-do-shell-command 
dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories 
dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"9d6333fab9c0f1b49e0bf2a536b8f245")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"154cdfbf451aedec60c5012b625ff329")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
@@ -4076,7 +4083,7 @@
 ;;;***
 
 ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
-;;;;;;  "c24f202ea049990539accfd4c2c73fe9")
+;;;;;;  "3b8851132739ab3f9054bf639873c53e")
 ;;; Generated autoloads from dired-x.el
 
 (autoload 'dired-jump "dired-x" "\


reply via email to

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