Eliminate side effects in pb/remove-prefix, and note that the prefix is a regexp

This commit is contained in:
Steve Purcell 2012-05-01 14:15:12 +01:00
parent fa271f3c9a
commit afb0db688d

View file

@ -497,11 +497,11 @@ of the same-named package which is to be kept."
(mapcar (lambda (path) (split-string path "/")) (mapcar (lambda (path) (split-string path "/"))
files)) "/")) files)) "/"))
(defun pb/remove-prefix (pfx str) (defun pb/remove-prefix (prefix string)
"Strip PFX from STR." "Strip PREFIX (a regexp) from STRING."
(if (string-match (concat "^" pfx) str) (if (string-match (concat "^" prefix) string)
(setq str (replace-match "" nil nil str)) (replace-match "" nil nil string)
str)) string))
;;; Public interface ;;; Public interface
(defun package-build-archive (name) (defun package-build-archive (name)