]> git.eshelyaron.com Git - emacs.git/commitdiff
(miscdic-convert): For MS-DOS, if
authorEli Zaretskii <eliz@gnu.org>
Fri, 6 Apr 2001 19:04:14 +0000 (19:04 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 6 Apr 2001 19:04:14 +0000 (19:04 +0000)
long file names aren't supported, truncate the file names in
quail-misc-package-ext-info to 8+3 before matching them against
FILENAME.

lisp/international/titdic-cnv.el

index 6894eb6dc41bfe6d0231fffca1e1c12a2838d920..98e68448646524d13d166ff077dc55dca5c9c332 100644 (file)
@@ -976,7 +976,15 @@ the generated Quail package is saved."
        name title dicfile coding quailfile converter copyright
        dicbuf)
     (while tail
-      (when (string-match (nth 2 (car tail)) filename)
+      (when (or (string-match (nth 2 (car tail)) filename)
+               ;; MS-DOS filesystem truncates file names to 8+3
+               ;; limits, so "cangjie-table.cns" becomes
+               ;; "cangjie-.cns", and the above string-match fails.
+               ;; Give DOS users a chance...
+               (and (fboundp 'msdos-long-file-names)
+                    (not (msdos-long-file-names))
+                    (string-match (dos-truncate-to-8+3 (nth 2 (car tail)))
+                                  filename)))
        (setq slot (car tail)
              name (car slot)
              title (nth 1 slot)