mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 18:22:25 +02:00
commit bash-20050324 snapshot
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
/* glob.c -- file-name wildcard pattern matching for Bash.
|
||||
|
||||
Copyright (C) 1985-2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985-2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -133,13 +133,13 @@ glob_pattern_p (pattern)
|
||||
int r;
|
||||
|
||||
if (MB_CUR_MAX == 1)
|
||||
return (internal_glob_pattern_p (pattern));
|
||||
return (internal_glob_pattern_p ((unsigned char *)pattern));
|
||||
|
||||
/* Convert strings to wide chars, and call the multibyte version. */
|
||||
n = xdupmbstowcs (&wpattern, NULL, pattern);
|
||||
if (n == (size_t)-1)
|
||||
/* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */
|
||||
return (internal_glob_pattern_p (pattern));
|
||||
return (internal_glob_pattern_p ((unsigned char *)pattern));
|
||||
|
||||
r = internal_glob_wpattern_p (wpattern);
|
||||
free (wpattern);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-2002 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -358,7 +358,7 @@ BRACKMATCH (p, test, flags)
|
||||
{
|
||||
bcopy (p + 1, ccname, (close - p - 1) * sizeof (CHAR));
|
||||
*(ccname + (close - p - 1)) = L('\0');
|
||||
pc = IS_CCLASS (test, ccname);
|
||||
pc = IS_CCLASS (test, (XCHAR *)ccname);
|
||||
}
|
||||
if (pc == -1)
|
||||
pc = 0;
|
||||
|
||||
+6
-4
@@ -1,7 +1,7 @@
|
||||
/* strmatch.c -- ksh-like extended pattern matching for the shell and filename
|
||||
globbing. */
|
||||
|
||||
/* Copyright (C) 1991-2002 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -93,14 +93,16 @@ collequiv (c1, c2)
|
||||
|
||||
static int
|
||||
collsym (s, len)
|
||||
char *s;
|
||||
CHAR *s;
|
||||
int len;
|
||||
{
|
||||
register struct _collsym *csp;
|
||||
char *x;
|
||||
|
||||
x = (char *)s;
|
||||
for (csp = posix_collsyms; csp->name; csp++)
|
||||
{
|
||||
if (STREQN(csp->name, s, len) && csp->name[len] == '\0')
|
||||
if (STREQN(csp->name, x, len) && csp->name[len] == '\0')
|
||||
return (csp->code);
|
||||
}
|
||||
if (len == 1)
|
||||
@@ -366,7 +368,7 @@ xstrmatch (pattern, string, flags)
|
||||
wchar_t *wpattern, *wstring;
|
||||
|
||||
if (MB_CUR_MAX == 1)
|
||||
return (internal_strmatch (pattern, string, flags));
|
||||
return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags));
|
||||
|
||||
n = xdupmbstowcs (&wpattern, NULL, pattern);
|
||||
if (n == (size_t)-1 || n == (size_t)-2)
|
||||
|
||||
Reference in New Issue
Block a user