X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fuudecode.el;h=299f83b914132aa03b2d3d31083e7f5a39a021f6;hb=7be1572552ba42fa35c42c055c9acf8d80497ea3;hp=06252d06930b9895bac64b97e90132f23df0d090;hpb=8944908a9e5aa4e0e29843510245e84337a2a8a5;p=elisp%2Fgnus.git- diff --git a/lisp/uudecode.el b/lisp/uudecode.el index 06252d0..299f83b 100644 --- a/lisp/uudecode.el +++ b/lisp/uudecode.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1998 by Shenghuo Zhu ;; Author: Shenghuo Zhu -;; $Revision: 5.4 $ +;; $Revision: 5.7 $ ;; Keywords: uudecode ;; This file is not part of GNU Emacs, but the same permissions @@ -55,7 +55,7 @@ input and write the converted data to its standard output.") (defvar uudecode-temporary-file-directory (cond ((fboundp 'temp-directory) (temp-directory)) ((boundp 'temporary-file-directory) temporary-file-directory) - ("/tmp/"))) + ("/tmp"))) ;;;###autoload (defun uudecode-decode-region-external (start end &optional file-name) @@ -75,9 +75,12 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (setq file-name (read-file-name "File to Name:" nil nil nil (match-string 1))))) - (setq tempfile (expand-file-name - (or file-name (concat uudecode-temporary-file-directory - (make-temp-name "uu"))))) + (setq tempfile (if file-name + (expand-file-name file-name) + (make-temp-name + ;; /tmp/uu... + (expand-file-name + "uu" uudecode-temporary-file-directory)))) (let ((cdir default-directory) default-process-coding-system) (unwind-protect (progn @@ -104,10 +107,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (insert-file-contents-literally tempfile))) (message "Can not uudecode"))) (and work-buffer (kill-buffer work-buffer)) - (condition-case () - (or file-name (delete-file tempfile)) - (error)) - ))) + (ignore-errors (or file-name (delete-file tempfile)))))) (if (string-match "XEmacs" emacs-version) (defalias 'uudecode-insert-char 'insert-char)