mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-03 12:31:32 -08:00
(scmp): Function moved from minibuf.c.
Delete multibyte handling--used only on encoded strings.
This commit is contained in:
parent
30de3bd611
commit
b3f04cedf4
1 changed files with 30 additions and 0 deletions
30
src/dired.c
30
src/dired.c
|
|
@ -117,6 +117,8 @@ Lisp_Object Qfile_name_completion;
|
|||
Lisp_Object Qfile_name_all_completions;
|
||||
Lisp_Object Qfile_attributes;
|
||||
Lisp_Object Qfile_attributes_lessp;
|
||||
|
||||
static int scmp P_ ((unsigned char *, unsigned char *, int));
|
||||
|
||||
|
||||
Lisp_Object
|
||||
|
|
@ -734,6 +736,34 @@ file_name_completion (file, dirname, all_flag, ver_flag)
|
|||
return Fsignal (Qquit, Qnil);
|
||||
}
|
||||
|
||||
/* Compare exactly LEN chars of strings at S1 and S2,
|
||||
ignoring case if appropriate.
|
||||
Return -1 if strings match,
|
||||
else number of chars that match at the beginning. */
|
||||
|
||||
static int
|
||||
scmp (s1, s2, len)
|
||||
register unsigned char *s1, *s2;
|
||||
int len;
|
||||
{
|
||||
register int l = len;
|
||||
|
||||
if (completion_ignore_case)
|
||||
{
|
||||
while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++))
|
||||
l--;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (l && *s1++ == *s2++)
|
||||
l--;
|
||||
}
|
||||
if (l == 0)
|
||||
return -1;
|
||||
else
|
||||
return len - l;
|
||||
}
|
||||
|
||||
static int
|
||||
file_name_completion_stat (dirname, dp, st_addr)
|
||||
Lisp_Object dirname;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue