Path splitting on NT.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 20 Sep 2000 21:50:32 +0000 (21:50 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 20 Sep 2000 21:50:32 +0000 (21:50 +0000)
lisp/ChangeLog
lisp/gnus-score.el
lisp/nnheader.el

index c9ef545..0ad7478 100644 (file)
@@ -1,3 +1,11 @@
+2000-07-16 Dmitry Bely <dbely@mail.ru>
+
+       * nnheader.el (nnheader-translate-file-chars): Path splitting on NT.
+
+2000-09-20 18:33:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-score.el (gnus-score-find-bnews): Use directory-sep-char.
+
 2000-09-20 17:37:46  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-default-charset): Set default value in
index 57c001e..5ee3fd6 100644 (file)
@@ -2551,7 +2551,7 @@ GROUP using BNews sys file syntax."
              ;; too much.
              (delete-char (min (1- (point-max)) klen))
            (goto-char (point-max))
-           (search-backward "/")
+           (search-backward (string directory-sep-char))
            (delete-region (1+ (point)) (point-min)))
          ;; If short file names were used, we have to translate slashes.
          (goto-char (point-min))
index 848d7e4..4b0198f 100644 (file)
@@ -633,10 +633,24 @@ If FULL, translate everything."
                      2 0))
        ;; We translate -- but only the file name.  We leave the directory
        ;; alone.
-       (if (string-match "/[^/]+\\'" file)
-           ;; This is needed on NT's and stuff.
-           (setq leaf (substring file (1+ (match-beginning 0)))
-                 path (substring file 0 (1+ (match-beginning 0))))
+       (if (memq system-type '(win32 w32 mswindows windows-nt))
+           ;; This is needed on NT and stuff, because
+           ;; file-name-nondirectory is not enough to split
+           ;; file names, containing ':', e.g.
+           ;; "d:\\Work\\News\\nntp+news.fido7.ru:fido7.ru.gnu.SCORE"
+           ;; 
+           ;; we are trying to correctly split such names:
+           ;; "d:file.name" -> "a:" "file.name"
+           ;; "aaa:bbb.ccc" -> "" "aaa:bbb.ccc"
+           ;; "d:aaa\\bbb:ccc"   -> "d:aaa\\" "bbb:ccc"
+           ;; etc.
+           ;; to translate then only the file name part.
+           (progn
+             (setq leaf file
+                   path "")
+             (if (string-match "\\(^\\w:\\|[/\\]\\)\\([^/\\]+\\)$" file)
+                 (setq leaf (substring file (match-beginning 2))
+                       path (substring file 0 (match-beginning 2)))))
          ;; Fall back on this.
          (setq leaf (file-name-nondirectory file)
                path (file-name-directory file))))