comparison src/dired.c @ 42169:5e1f90b72764

(scmp): Function moved from minibuf.c. Delete multibyte handling--used only on encoded strings.
author Richard M. Stallman <rms@gnu.org>
date Tue, 18 Dec 2001 22:50:26 +0000
parents a17c8b15ef1b
children 37cdbf5d5a09
comparison
equal deleted inserted replaced
42168:e08cd63afb2e 42169:5e1f90b72764
115 Lisp_Object Qdirectory_files_and_attributes; 115 Lisp_Object Qdirectory_files_and_attributes;
116 Lisp_Object Qfile_name_completion; 116 Lisp_Object Qfile_name_completion;
117 Lisp_Object Qfile_name_all_completions; 117 Lisp_Object Qfile_name_all_completions;
118 Lisp_Object Qfile_attributes; 118 Lisp_Object Qfile_attributes;
119 Lisp_Object Qfile_attributes_lessp; 119 Lisp_Object Qfile_attributes_lessp;
120
121 static int scmp P_ ((unsigned char *, unsigned char *, int));
120 122
121 123
122 Lisp_Object 124 Lisp_Object
123 directory_files_internal_unwind (dh) 125 directory_files_internal_unwind (dh)
124 Lisp_Object dh; 126 Lisp_Object dh;
732 if (d) closedir (d); 734 if (d) closedir (d);
733 Vquit_flag = Qnil; 735 Vquit_flag = Qnil;
734 return Fsignal (Qquit, Qnil); 736 return Fsignal (Qquit, Qnil);
735 } 737 }
736 738
739 /* Compare exactly LEN chars of strings at S1 and S2,
740 ignoring case if appropriate.
741 Return -1 if strings match,
742 else number of chars that match at the beginning. */
743
744 static int
745 scmp (s1, s2, len)
746 register unsigned char *s1, *s2;
747 int len;
748 {
749 register int l = len;
750
751 if (completion_ignore_case)
752 {
753 while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++))
754 l--;
755 }
756 else
757 {
758 while (l && *s1++ == *s2++)
759 l--;
760 }
761 if (l == 0)
762 return -1;
763 else
764 return len - l;
765 }
766
737 static int 767 static int
738 file_name_completion_stat (dirname, dp, st_addr) 768 file_name_completion_stat (dirname, dp, st_addr)
739 Lisp_Object dirname; 769 Lisp_Object dirname;
740 DIRENTRY *dp; 770 DIRENTRY *dp;
741 struct stat *st_addr; 771 struct stat *st_addr;