Imported from ../bash-2.02.1.tar.gz.
This commit is contained in:
parent
cce855bc5b
commit
bc4cd23ce9
23 changed files with 204 additions and 70 deletions
|
@ -37,9 +37,6 @@ static int extmatch ();
|
|||
|
||||
/* Note that these evaluate C many times. */
|
||||
|
||||
#define ISUPPER(c) (isascii (c) && isupper (c))
|
||||
#define ISLOWER(c) (isascii (c) && islower (c))
|
||||
|
||||
#ifndef isblank
|
||||
# define isblank(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
|
@ -52,7 +49,10 @@ static int extmatch ();
|
|||
# define isxdigit(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
|
||||
#endif
|
||||
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
/* The result of FOLD is an `unsigned char' */
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && isupper ((unsigned char)c) \
|
||||
? tolower ((unsigned char)c) \
|
||||
: ((unsigned char)c))
|
||||
|
||||
#ifndef STREQ
|
||||
#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0)
|
||||
|
@ -190,7 +190,7 @@ gmatch (string, se, pattern, pe, flags)
|
|||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD (sc) != c)
|
||||
if (FOLD (sc) != (unsigned char)c)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
|
@ -240,9 +240,9 @@ gmatch (string, se, pattern, pe, flags)
|
|||
|
||||
/* General case, use recursion. */
|
||||
{
|
||||
char c1;
|
||||
unsigned char c1;
|
||||
|
||||
c1 = ((flags & FNM_NOESCAPE) == 0 && c == '\\') ? *p : c;
|
||||
c1 = (unsigned char)((flags & FNM_NOESCAPE) == 0 && c == '\\') ? *p : c;
|
||||
c1 = FOLD (c1);
|
||||
for (--p; n < se; ++n)
|
||||
/* Only call fnmatch if the first character indicates a
|
||||
|
@ -272,7 +272,7 @@ gmatch (string, se, pattern, pe, flags)
|
|||
break;
|
||||
|
||||
default:
|
||||
if (c != FOLD (sc))
|
||||
if ((unsigned char)c != FOLD (sc))
|
||||
return (FNM_NOMATCH);
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ brackmatch (p, test, flags)
|
|||
else if (STREQN (p+1, "graph:]", 7))
|
||||
{ pc = isgraph (test); p += 8; }
|
||||
else if (STREQN (p+1, "lower:]", 7))
|
||||
{ pc = ISLOWER (test); p += 8; }
|
||||
{ pc = islower (test); p += 8; }
|
||||
else if (STREQN (p+1, "print:]", 7))
|
||||
{ pc = isprint (test); p += 8; }
|
||||
else if (STREQN (p+1, "punct:]", 7))
|
||||
|
@ -386,7 +386,7 @@ brackmatch (p, test, flags)
|
|||
else if (STREQN (p+1, "space:]", 7))
|
||||
{ pc = isspace (test); p += 8; }
|
||||
else if (STREQN (p+1, "upper:]", 7))
|
||||
{ pc = ISUPPER (test); p += 8; }
|
||||
{ pc = isupper (test); p += 8; }
|
||||
else if (STREQN (p+1, "xdigit:]", 8))
|
||||
{ pc = isxdigit (test); p += 9; }
|
||||
else if (STREQN (p+1, "ascii:]", 7))
|
||||
|
|
|
@ -184,7 +184,7 @@ struct bucket_stats {
|
|||
enough room in the block for the new size. Range checking is always
|
||||
done. */
|
||||
union mhead {
|
||||
union mhead *mh_align;
|
||||
double mh_align;
|
||||
struct {
|
||||
char mi_alloc; /* ISALLOC or ISFREE */ /* 1 */
|
||||
char mi_index; /* index in nextf[] */ /* 1 */
|
||||
|
|
|
@ -423,7 +423,14 @@ rl_redisplay ()
|
|||
contents of the command line? */
|
||||
while (lpos >= screenwidth)
|
||||
{
|
||||
#if 0
|
||||
temp = ((newlines + 1) * screenwidth) - ((newlines == 0) ? wrap_offset : 0);
|
||||
#else
|
||||
/* XXX - possible fix from Darin Johnson <darin@acuson.com> for prompt
|
||||
string with invisible characters that is longer than the screen
|
||||
width. */
|
||||
temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0);
|
||||
#endif
|
||||
inv_lbreaks[++newlines] = temp;
|
||||
lpos -= screenwidth;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue