changeset 73986:2443b8a6f498

(mh-x-image-url-cache-canonicalize): Add `*' to reserved Windows filename characters (closes SF #1396499).
author Bill Wohler <wohler@newt.com>
date Tue, 14 Nov 2006 06:30:43 +0000
parents 5783c1198e3b
children e894b4d1b811
files lisp/mh-e/mh-xface.el
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/mh-xface.el	Mon Nov 13 22:05:06 2006 +0000
+++ b/lisp/mh-e/mh-xface.el	Tue Nov 14 06:30:43 2006 +0000
@@ -361,14 +361,16 @@
 Replace the ?/ character with a ?! character and append .png.
 Also replaces special characters with `mh-url-hexify-string'
 since not all characters, such as :, are legal within Windows
-filenames. See URL
-`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp'."
+filenames. In addition, replaces * with %2a. See URL
+`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'."
   (format "%s/%s.png" mh-x-image-cache-directory
-          (mh-url-hexify-string
-           (with-temp-buffer
-             (insert url)
-             (mh-replace-string "/" "!")
-             (buffer-string)))))
+          (mh-replace-regexp-in-string
+           "\*" "%2a"
+           (mh-url-hexify-string
+            (with-temp-buffer
+              (insert url)
+              (mh-replace-string "/" "!")
+              (buffer-string))))))
 
 (defun mh-x-image-get-download-state (file)
   "Check the state of FILE by following any symbolic links."