[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs qe.h util.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs qe.h util.c |
Date: |
Fri, 07 Feb 2014 07:38:33 +0000 |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 14/02/07 07:38:33
Modified files:
. : qe.h util.c
Log message:
ignore case when matching extensions.
* ignore case in match_extension() used for mode selection
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.136&r2=1.137
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.61&r2=1.62
Patches:
Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- qe.h 5 Feb 2014 00:56:49 -0000 1.136
+++ qe.h 7 Feb 2014 07:38:30 -0000 1.137
@@ -307,6 +307,7 @@
return (unsigned int *)memcpy(dest, src, count * sizeof(unsigned int));
}
int umemcmp(const unsigned int *s1, const unsigned int *s2, int count);
+int qe_memicmp(const void *p1, const void *p2, int count);
int strsubst(char *buf, int buf_size, const char *from,
const char *s1, const char *s2);
Index: util.c
===================================================================
RCS file: /sources/qemacs/qemacs/util.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- util.c 24 Jan 2014 00:46:27 -0000 1.61
+++ util.c 7 Feb 2014 07:38:31 -0000 1.62
@@ -375,7 +375,7 @@
int len1 = p - q;
if (len1 != 0 || (q != extlist && c != '\0')) {
if (len > len1 && base[len - len1 - 1] == '.'
- && !memcmp(base + (len - len1), q, len1)) {
+ && !qe_memicmp(base + (len - len1), q, len1)) {
return 1;
}
}
@@ -645,6 +645,22 @@
return NULL;
}
+int qe_memicmp(const void *p1, const void *p2, int count)
+{
+ const u8 *s1 = (const u8 *)p1;
+ const u8 *s2 = (const u8 *)p2;
+
+ for (; count-- > 0; s1++, s2++) {
+ if (*s1 != *s2) {
+ int c1 = qe_toupper(*s1);
+ int c2 = qe_toupper(*s2);
+ if (c1 != c2)
+ return (c2 < c1) - (c1 < c2);
+ }
+ }
+ return 0;
+}
+
/**
* Return TRUE if val is a prefix of str (case independent). If it
* returns TRUE, ptr is set to the next character in 'str' after the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs qe.h util.c,
Charlie Gordon <=