emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/jka-compr.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/jka-compr.el,v
Date: Mon, 29 Jan 2007 02:51:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/01/29 02:51:41

Index: jka-compr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/jka-compr.el,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -b -r1.93 -r1.94
--- jka-compr.el        27 Jan 2007 11:55:59 -0000      1.93
+++ jka-compr.el        29 Jan 2007 02:51:41 -0000      1.94
@@ -155,6 +155,12 @@
        ;; to discard the part we don't want.
        (let ((skip (/ beg jka-compr-dd-blocksize))
              (err-file (jka-compr-make-temp-name))
+             ;; call-process barfs if default-directory is inaccessible.
+             (default-directory
+               (if (and default-directory
+                        (file-accessible-directory-p default-directory))
+                   default-directory
+                 (file-name-directory infile)))
              count)
          ;; Update PREFIX based on the text that we won't read in.
          (setq prefix (- beg (* skip jka-compr-dd-blocksize))
@@ -193,14 +199,17 @@
 
 
 (defun jka-compr-call-process (prog message infile output temp args)
+  ;; call-process barfs if default-directory is inaccessible.
+  (let ((default-directory
+         (if (and default-directory
+                  (file-accessible-directory-p default-directory))
+             default-directory
+           (file-name-directory infile))))
   (if jka-compr-use-shell
-
       (let ((err-file (jka-compr-make-temp-name))
            (coding-system-for-read (or coding-system-for-read 'undecided))
             (coding-system-for-write 'no-conversion))
-
        (unwind-protect
-
            (or (memq
                 (call-process jka-compr-shell infile
                               (if (stringp output) nil output)
@@ -214,24 +223,17 @@
                                           (concat "> " output)
                                         "")))
                 jka-compr-acceptable-retval-list)
-
                (jka-compr-error prog args infile message err-file))
-
          (jka-compr-delete-temp-file err-file)))
-
     (or (eq 0
         (apply 'call-process
-               prog
-               infile
-               (if (stringp output) temp output)
-               nil
-               args))
+                    prog infile (if (stringp output) temp output)
+                    nil args))
        (jka-compr-error prog args infile message))
-
     (and (stringp output)
         (with-current-buffer temp
           (write-region (point-min) (point-max) output)
-          (erase-buffer)))))
+            (erase-buffer))))))
 
 
 ;; Support for temp files.  Much of this was inspired if not lifted




reply via email to

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