aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-09-07 04:53:31 +0000
committerStefan Monnier2004-09-07 04:53:31 +0000
commitac62b9e443a436d11dba361f940dbe11bacf352a (patch)
treed4ae9d5e386d789c07851d314c6fe7dd65376c7f
parent45ce59421eb2876e8169f4fbfe42b95d61da9bb6 (diff)
downloademacs-ac62b9e443a436d11dba361f940dbe11bacf352a.tar.gz
emacs-ac62b9e443a436d11dba361f940dbe11bacf352a.zip
(cvs-string-prefix-p): Use compare-strings.
-rw-r--r--lisp/pcvs-util.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el
index 3380077c74a..5d9d0d215af 100644
--- a/lisp/pcvs-util.el
+++ b/lisp/pcvs-util.el
@@ -1,7 +1,7 @@
1;;; pcvs-util.el --- utility functions for PCL-CVS -*- byte-compile-dynamic: t -*- 1;;; pcvs-util.el --- utility functions for PCL-CVS -*- byte-compile-dynamic: t -*-
2 2
3;; Copyright (C) 1991,92,93,94,95,96,97,98,99, 2000,01,04 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; Free Software Foundation, Inc. 4;; 2000, 2001, 2004 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@cs.yale.edu>
7;; Keywords: pcl-cvs 7;; Keywords: pcl-cvs
@@ -180,9 +180,7 @@ arguments. If ARGS is not a list, no argument will be passed."
180 180
181(defun cvs-string-prefix-p (str1 str2) 181(defun cvs-string-prefix-p (str1 str2)
182 "Tell whether STR1 is a prefix of STR2." 182 "Tell whether STR1 is a prefix of STR2."
183 (let ((length1 (length str1))) 183 (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
184 (and (>= (length str2) length1)
185 (string= str1 (substring str2 0 length1)))))
186 184
187;; (string->strings (strings->string X)) == X 185;; (string->strings (strings->string X)) == X
188(defun cvs-strings->string (strings &optional separator) 186(defun cvs-strings->string (strings &optional separator)
@@ -392,5 +390,5 @@ and reset it unless READ-ONLY is non-nil."
392 390
393(provide 'pcvs-util) 391(provide 'pcvs-util)
394 392
395;;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59 393;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
396;;; pcvs-util.el ends here 394;;; pcvs-util.el ends here