[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs util.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs util.c |
Date: |
Tue, 25 Mar 2008 11:05:46 +0000 |
CVSROOT: /cvsroot/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 08/03/25 11:05:46
Modified files:
. : util.c
Log message:
ignore numeric extensions in extension() and match_extension()
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.38&r2=1.39
Patches:
Index: util.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/util.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- util.c 18 Jan 2008 17:03:35 -0000 1.38
+++ util.c 25 Mar 2008 11:05:45 -0000 1.39
@@ -300,9 +300,11 @@
while (*p == '.')
p++;
for (; *p; p++) {
- if (*p == '.')
+ if (*p == '.') {
+ if (!ext || !qe_isdigit(p[1]))
ext = p;
}
+ }
if (!ext)
ext = p;
}
@@ -340,7 +342,16 @@
r = extension(filename);
if (*r == '.') {
- return strcasefind(extlist, r + 1);
+ char buf[32];
+ char *p;
+
+ /* Match extensions in lowercase, strip extra extensions.
+ * thus ignoring cvs version tags (as in .#cutils.c.1.13)
+ */
+ qe_strtolower(buf, sizeof(buf), r + 1);
+ if ((p = strchr(buf, '.')) != NULL)
+ *p = '\0';
+ return strfind(extlist, buf);
} else {
return 0;
}
- [Qemacs-commit] qemacs util.c,
Charlie Gordon <=