summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/glob.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-08-12 03:45:53 +0000
committerache <ache@FreeBSD.org>1996-08-12 03:45:53 +0000
commitce519bc5d052e13e3d9f00842dd30c91d01932b6 (patch)
tree6bad66a394d9a9b85ce1e525b03f3e882ffeaa6a /lib/libc/gen/glob.c
parent378240cb4bb850ae8415951372ef2774772e00d2 (diff)
downloadFreeBSD-src-ce519bc5d052e13e3d9f00842dd30c91d01932b6.zip
FreeBSD-src-ce519bc5d052e13e3d9f00842dd30c91d01932b6.tar.gz
Remove static collcmp, ise new internal function now
Diffstat (limited to 'lib/libc/gen/glob.c')
-rw-r--r--lib/libc/gen/glob.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index bb2fb18..cfea035 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -75,6 +75,7 @@ static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "collate.h"
#define DOLLAR '$'
#define DOT '.'
@@ -147,7 +148,6 @@ static int match __P((Char *, Char *, Char *));
#ifdef DEBUG
static void qprintf __P((const char *, Char *));
#endif
-static int collcmp __P((int, int));
int
glob(pattern, flags, errfunc, pglob)
@@ -669,38 +669,6 @@ globextend(path, pglob)
return(copy == NULL ? GLOB_NOSPACE : 0);
}
-static int
-collcmp (c1, c2)
- int c1, c2;
-{
- static char s1[2], s2[2];
-
- if (c1 == c2)
- return (0);
- if ( (isascii(c1) && isascii(c2))
- || (!isalpha(c1) && !isalpha(c2))
- )
- return (c1 - c2);
- if (isalpha(c1) && !isalpha(c2)) {
- if (isupper(c1))
- return ('A' - c2);
- else
- return ('a' - c2);
- } else if (isalpha(c2) && !isalpha(c1)) {
- if (isupper(c2))
- return (c1 - 'A');
- else
- return (c1 - 'a');
- }
- if (isupper(c1) && islower(c2))
- return (-1);
- else if (islower(c1) && isupper(c2))
- return (1);
- s1[0] = c1;
- s2[0] = c2;
- return strcoll(s1, s2);
-}
-
/*
* pattern matching function for filenames. Each occurrence of the *
* pattern causes a recursion level.
@@ -735,8 +703,8 @@ match(name, pat, patend)
++pat;
while (((c = *pat++) & M_MASK) != M_END)
if ((*pat & M_MASK) == M_RNG) {
- if ( collcmp(CHAR(c), CHAR(k)) <= 0
- && collcmp(CHAR(k), CHAR(pat[1])) <= 0
+ if ( __collcmp(CHAR(c), CHAR(k)) <= 0
+ && __collcmp(CHAR(k), CHAR(pat[1])) <= 0
)
ok = 1;
pat += 2;
OpenPOWER on IntegriCloud