Mercurial > emacs
comparison src/minibuf.c @ 9183:f49aca34b7ae
(scmp): Use unsigned chars, to avoid confusing DOWNCASE.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 29 Sep 1994 19:37:26 +0000 |
parents | ed766dfb4efe |
children | 5f7cfbdef872 |
comparison
equal
deleted
inserted
replaced
9182:516fdeee89d6 | 9183:f49aca34b7ae |
---|---|
772 /* Compare exactly LEN chars of strings at S1 and S2, | 772 /* Compare exactly LEN chars of strings at S1 and S2, |
773 ignoring case if appropriate. | 773 ignoring case if appropriate. |
774 Return -1 if strings match, | 774 Return -1 if strings match, |
775 else number of chars that match at the beginning. */ | 775 else number of chars that match at the beginning. */ |
776 | 776 |
777 int | |
777 scmp (s1, s2, len) | 778 scmp (s1, s2, len) |
778 register char *s1, *s2; | 779 register unsigned char *s1, *s2; |
779 int len; | 780 int len; |
780 { | 781 { |
781 register int l = len; | 782 register int l = len; |
782 | 783 |
783 if (completion_ignore_case) | 784 if (completion_ignore_case) |
790 while (l && *s1++ == *s2++) | 791 while (l && *s1++ == *s2++) |
791 l--; | 792 l--; |
792 } | 793 } |
793 if (l == 0) | 794 if (l == 0) |
794 return -1; | 795 return -1; |
795 else return len - l; | 796 else |
797 return len - l; | |
796 } | 798 } |
797 | 799 |
798 DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0, | 800 DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0, |
799 "Search for partial matches to STRING in ALIST.\n\ | 801 "Search for partial matches to STRING in ALIST.\n\ |
800 Each car of each element of ALIST is tested to see if it begins with STRING.\n\ | 802 Each car of each element of ALIST is tested to see if it begins with STRING.\n\ |