emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7582497: Check that file argument is a string


From: Noam Postavsky
Subject: [Emacs-diffs] master 7582497: Check that file argument is a string
Date: Fri, 7 Apr 2017 18:28:45 -0400 (EDT)

branch: master
commit 75824977851f27146638672bba4d3789f2a32612
Author: Kaushal Modi <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Check that file argument is a string
    
    * lisp/vc/ediff-diff.el (ediff-exec-process): Check that the argument
      passed to `file-local-copy' is a string (Bug#26378).  Also fix
      the existing comment for this function, and convert it to its
      doc-string.
---
 lisp/vc/ediff-diff.el | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el
index cfa08ef..ded82c4 100644
--- a/lisp/vc/ediff-diff.el
+++ b/lisp/vc/ediff-diff.el
@@ -1134,12 +1134,20 @@ delimiter regions"))
    ))
 
 
-;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
-;; SYNCH is non-nil.  BUFFER must be a buffer object, and must be alive.  The
-;; OPTIONS arg is a list of options to pass to PROGRAM. It may be a blank
-;; string.  All elements in FILES must be strings.  We also delete nil from
-;; args.
 (defun ediff-exec-process (program buffer synch options &rest files)
+  "Execute the diff PROGRAM.
+
+The PROGRAM output is sent to BUFFER, which must be a live buffer
+object.
+
+The PROGRAM is executed asynchronously unless `system-type' is
+`windows-nt' or `ms-dos', or SYNCH is non-nil.
+
+OPTIONS is a string of space-separated options to pass to PROGRAM.  It
+may be a blank string.
+
+FILES is a list of filenames to pass to PROGRAM; nil and \"\" elements
+are ignored."
   (let ((data (match-data))
        ;; If this is a buffer job, we are diffing temporary files
        ;; produced by Emacs with ediff-coding-system-for-write, so
@@ -1151,8 +1159,9 @@ delimiter regions"))
        args)
     (setq args (append (split-string options)
                        (mapcar (lambda (file)
-                                 (file-name-unquote
-                                  (or (file-local-copy file) file)))
+                                 (when (stringp file)
+                                   (file-name-unquote
+                                    (or (file-local-copy file) file))))
                                files)))
     (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments
     ;; the --binary option, if present, should be used only for buffer jobs



reply via email to

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