summaryrefslogtreecommitdiff
path: root/bin/csh
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-08-12 21:32:15 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-08-12 21:32:15 +0000
commita1a0a1f9c74968581650bff15ee82050111bd96d (patch)
tree843486855b6c29485bb5067cfa6312d39e2914e0 /bin/csh
parent3f0aecd3b54bbac26f8cfcad46aa68a70d5f0921 (diff)
downloadsrc-test2-a1a0a1f9c74968581650bff15ee82050111bd96d.tar.gz
src-test2-a1a0a1f9c74968581650bff15ee82050111bd96d.zip
Notes
Diffstat (limited to 'bin/csh')
-rw-r--r--bin/csh/glob.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/bin/csh/glob.c b/bin/csh/glob.c
index e429ff600ca7..0d48231c3085 100644
--- a/bin/csh/glob.c
+++ b/bin/csh/glob.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: glob.c,v 1.3 1995/05/30 00:06:35 rgrimes Exp $
+ * $Id: glob.c,v 1.4 1996/08/12 02:08:43 ache Exp $
*/
#ifndef lint
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
#include <sys/param.h>
#include <glob.h>
+#include <locale.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -93,7 +94,6 @@ static int pmatch __P((Char *, Char *));
static void pword __P((void));
static void psave __P((int));
static void backeval __P((Char *, bool));
-static int collcmp __P((int, int));
static Char *
@@ -833,38 +833,6 @@ Gmatch(string, pattern)
}
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);
-}
-
-static int
pmatch(string, pattern)
register Char *string, *pattern;
{
@@ -899,8 +867,8 @@ pmatch(string, pattern)
if (match)
continue;
if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') {
- match = ( collcmp(stringc, *pattern & TRIM) <= 0
- && collcmp(*(pattern-2) & TRIM, stringc) <= 0
+ match = ( collate_range_cmp(stringc, *pattern & TRIM) <= 0
+ && collate_range_cmp(*(pattern-2) & TRIM, stringc) <= 0
);
pattern++;
}