diff options
author | Glenn Morris <rgm@gnu.org> | 2009-02-10 03:27:29 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2009-02-10 03:27:29 +0000 |
commit | f0cfa8f0c2bbe2efcf24880e95a49c555bcdbc4e (patch) | |
tree | c946b2c2b2279d2354be8dae7fd7a1117d0ca75e /lisp/url | |
parent | 908e900dce6f9eb1c13fae3411797512d8933344 (diff) | |
download | emacs-f0cfa8f0c2bbe2efcf24880e95a49c555bcdbc4e.tar.gz |
(url-generate-unique-filename): Silence compiler.
Diffstat (limited to 'lisp/url')
-rw-r--r-- | lisp/url/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/url/url-util.el | 36 |
2 files changed, 23 insertions, 17 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 20c0f380f5d..9212abfa6ad 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,7 @@ +2009-02-10 Glenn Morris <rgm@gnu.org> + + * url-util.el (url-generate-unique-filename): Silence compiler. + 2009-02-07 Chong Yidong <cyd@stupidchicken.com> * url-file.el (url-file): Use make-temp-file. diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 622dfbf5bf6..65ac0fd8db3 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -1,7 +1,7 @@ ;;; url-util.el --- Miscellaneous helper routines for URL library -;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2006, 2007, +;; 2008, 2009 Free Software Foundation, Inc. ;; Author: Bill Perry <wmperry@gnu.org> ;; Keywords: comm, data, processes @@ -476,25 +476,27 @@ Has a preference for looking backward when not directly on a symbol." (defun url-generate-unique-filename (&optional fmt) "Generate a unique filename in `url-temporary-directory'." - (if (not fmt) - (let ((base (format "url-tmp.%d" (user-real-uid))) + ;; This variable is obsolete, but so is this function. + (let ((tempdir (with-no-warnings url-temporary-directory))) + (if (not fmt) + (let ((base (format "url-tmp.%d" (user-real-uid))) + (fname "") + (x 0)) + (setq fname (format "%s%d" base x)) + (while (file-exists-p + (expand-file-name fname tempdir)) + (setq x (1+ x) + fname (concat base (int-to-string x)))) + (expand-file-name fname tempdir)) + (let ((base (concat "url" (int-to-string (user-real-uid)))) (fname "") (x 0)) - (setq fname (format "%s%d" base x)) + (setq fname (format fmt (concat base (int-to-string x)))) (while (file-exists-p - (expand-file-name fname url-temporary-directory)) + (expand-file-name fname tempdir)) (setq x (1+ x) - fname (concat base (int-to-string x)))) - (expand-file-name fname url-temporary-directory)) - (let ((base (concat "url" (int-to-string (user-real-uid)))) - (fname "") - (x 0)) - (setq fname (format fmt (concat base (int-to-string x)))) - (while (file-exists-p - (expand-file-name fname url-temporary-directory)) - (setq x (1+ x) - fname (format fmt (concat base (int-to-string x))))) - (expand-file-name fname url-temporary-directory)))) + fname (format fmt (concat base (int-to-string x))))) + (expand-file-name fname tempdir))))) (make-obsolete 'url-generate-unique-filename 'make-temp-file "23.1") (defun url-extract-mime-headers () |