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)) "/"))
(defun pb/remove-prefix (prefix string)
"Strip PREFIX (a regexp) from STRING."
(if (string-match (concat "^" prefix) string)
(replace-match "" nil nil string)
"Strip PREFIX from STRING."
(if (string-prefix-p prefix string)
(substring string (length prefix))
string))
;;; Public interface