Don't interpret PREFIX as a regexp in pb/remove-prefix

This commit is contained in:
Steve Purcell 2012-05-01 14:22:29 +01:00
parent c5f641f8fb
commit 2bdf9d0a87

View file

@ -498,9 +498,9 @@ of the same-named package which is to be kept."
files)) "/")) files)) "/"))
(defun pb/remove-prefix (prefix string) (defun pb/remove-prefix (prefix string)
"Strip PREFIX (a regexp) from STRING." "Strip PREFIX from STRING."
(if (string-match (concat "^" prefix) string) (if (string-prefix-p prefix string)
(replace-match "" nil nil string) (substring string (length prefix))
string)) string))
;;; Public interface ;;; Public interface