diff options
| author | Glenn Morris | 2009-02-10 03:27:29 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-02-10 03:27:29 +0000 |
| commit | f0cfa8f0c2bbe2efcf24880e95a49c555bcdbc4e (patch) | |
| tree | c946b2c2b2279d2354be8dae7fd7a1117d0ca75e | |
| parent | 908e900dce6f9eb1c13fae3411797512d8933344 (diff) | |
| download | emacs-f0cfa8f0c2bbe2efcf24880e95a49c555bcdbc4e.tar.gz emacs-f0cfa8f0c2bbe2efcf24880e95a49c555bcdbc4e.zip | |
(url-generate-unique-filename): Silence compiler.
| -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 @@ | |||
| 1 | 2009-02-10 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * url-util.el (url-generate-unique-filename): Silence compiler. | ||
| 4 | |||
| 1 | 2009-02-07 Chong Yidong <cyd@stupidchicken.com> | 5 | 2009-02-07 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * url-file.el (url-file): Use make-temp-file. | 7 | * 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 @@ | |||
| 1 | ;;; url-util.el --- Miscellaneous helper routines for URL library | 1 | ;;; url-util.el --- Miscellaneous helper routines for URL library |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, | 3 | ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2006, 2007, |
| 4 | ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 4 | ;; 2008, 2009 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Bill Perry <wmperry@gnu.org> | 6 | ;; Author: Bill Perry <wmperry@gnu.org> |
| 7 | ;; Keywords: comm, data, processes | 7 | ;; Keywords: comm, data, processes |
| @@ -476,25 +476,27 @@ Has a preference for looking backward when not directly on a symbol." | |||
| 476 | 476 | ||
| 477 | (defun url-generate-unique-filename (&optional fmt) | 477 | (defun url-generate-unique-filename (&optional fmt) |
| 478 | "Generate a unique filename in `url-temporary-directory'." | 478 | "Generate a unique filename in `url-temporary-directory'." |
| 479 | (if (not fmt) | 479 | ;; This variable is obsolete, but so is this function. |
| 480 | (let ((base (format "url-tmp.%d" (user-real-uid))) | 480 | (let ((tempdir (with-no-warnings url-temporary-directory))) |
| 481 | (if (not fmt) | ||
| 482 | (let ((base (format "url-tmp.%d" (user-real-uid))) | ||
| 483 | (fname "") | ||
| 484 | (x 0)) | ||
| 485 | (setq fname (format "%s%d" base x)) | ||
| 486 | (while (file-exists-p | ||
| 487 | (expand-file-name fname tempdir)) | ||
| 488 | (setq x (1+ x) | ||
| 489 | fname (concat base (int-to-string x)))) | ||
| 490 | (expand-file-name fname tempdir)) | ||
| 491 | (let ((base (concat "url" (int-to-string (user-real-uid)))) | ||
| 481 | (fname "") | 492 | (fname "") |
| 482 | (x 0)) | 493 | (x 0)) |
| 483 | (setq fname (format "%s%d" base x)) | 494 | (setq fname (format fmt (concat base (int-to-string x)))) |
| 484 | (while (file-exists-p | 495 | (while (file-exists-p |
| 485 | (expand-file-name fname url-temporary-directory)) | 496 | (expand-file-name fname tempdir)) |
| 486 | (setq x (1+ x) | 497 | (setq x (1+ x) |
| 487 | fname (concat base (int-to-string x)))) | 498 | fname (format fmt (concat base (int-to-string x))))) |
| 488 | (expand-file-name fname url-temporary-directory)) | 499 | (expand-file-name fname tempdir))))) |
| 489 | (let ((base (concat "url" (int-to-string (user-real-uid)))) | ||
| 490 | (fname "") | ||
| 491 | (x 0)) | ||
| 492 | (setq fname (format fmt (concat base (int-to-string x)))) | ||
| 493 | (while (file-exists-p | ||
| 494 | (expand-file-name fname url-temporary-directory)) | ||
| 495 | (setq x (1+ x) | ||
| 496 | fname (format fmt (concat base (int-to-string x))))) | ||
| 497 | (expand-file-name fname url-temporary-directory)))) | ||
| 498 | (make-obsolete 'url-generate-unique-filename 'make-temp-file "23.1") | 500 | (make-obsolete 'url-generate-unique-filename 'make-temp-file "23.1") |
| 499 | 501 | ||
| 500 | (defun url-extract-mime-headers () | 502 | (defun url-extract-mime-headers () |