changeset 20758:f5a113b108ff

(msb--strip-dir): Use Emacs filename primitives, not regexps.
author Richard M. Stallman <rms@gnu.org>
date Fri, 23 Jan 1998 06:42:27 +0000
parents f900cfe382e4
children e3cf980dad70
files lisp/msb.el
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/msb.el	Fri Jan 23 02:14:02 1998 +0000
+++ b/lisp/msb.el	Fri Jan 23 06:42:27 1998 +0000
@@ -456,14 +456,7 @@
 
 ;; Strip one hierarchy level from the end of DIR.
 (defun msb--strip-dir (dir)
-  (save-match-data
-    (cond
-     ((string-match "^\\([^/]*/.+/\\)[^/]+$" dir)
-      (substring dir (match-beginning 1) (match-end 1)))
-     ((string-match "^\\([^/]*/\\)" dir)
-      (substring dir (match-beginning 1) (match-end 1)))
-     (t
-      (error "msb: Directory `%s' has an unrecognized format" dir)))))
+  (file-name-directory (directory-file-name dir)))
 
 ;; Create an alist with all buffers from LIST that lies under the same
 ;; directory will be in the same item as the directory string.