mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-10 12:10:35 +02:00
Bash-5.3-alpha release
This commit is contained in:
+48
-68
@@ -43,8 +43,8 @@
|
||||
#include <ctype.h>
|
||||
|
||||
/* System-specific feature definitions and include files. */
|
||||
#include "rldefs.h"
|
||||
#include "rlmbutil.h"
|
||||
#include "rldefs.h"
|
||||
|
||||
#if defined (TIOCSTAT_IN_SYS_IOCTL)
|
||||
# include <sys/ioctl.h>
|
||||
@@ -229,26 +229,12 @@ rl_tilde_expand (int ignore, int key)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if defined (USE_VARARGS)
|
||||
void
|
||||
#if defined (PREFER_STDARG)
|
||||
_rl_ttymsg (const char *format, ...)
|
||||
#else
|
||||
_rl_ttymsg (va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list args;
|
||||
#if defined (PREFER_VARARGS)
|
||||
char *format;
|
||||
#endif
|
||||
|
||||
#if defined (PREFER_STDARG)
|
||||
va_start (args, format);
|
||||
#else
|
||||
va_start (args);
|
||||
format = va_arg (args, char *);
|
||||
#endif
|
||||
|
||||
fprintf (stderr, "readline: ");
|
||||
vfprintf (stderr, format, args);
|
||||
@@ -261,24 +247,11 @@ _rl_ttymsg (va_alist)
|
||||
}
|
||||
|
||||
void
|
||||
#if defined (PREFER_STDARG)
|
||||
_rl_errmsg (const char *format, ...)
|
||||
#else
|
||||
_rl_errmsg (va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list args;
|
||||
#if defined (PREFER_VARARGS)
|
||||
char *format;
|
||||
#endif
|
||||
|
||||
#if defined (PREFER_STDARG)
|
||||
va_start (args, format);
|
||||
#else
|
||||
va_start (args);
|
||||
format = va_arg (args, char *);
|
||||
#endif
|
||||
|
||||
fprintf (stderr, "readline: ");
|
||||
vfprintf (stderr, format, args);
|
||||
@@ -288,28 +261,6 @@ _rl_errmsg (va_alist)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
#else /* !USE_VARARGS */
|
||||
void
|
||||
_rl_ttymsg (format, arg1, arg2)
|
||||
char *format;
|
||||
{
|
||||
fprintf (stderr, "readline: ");
|
||||
fprintf (stderr, format, arg1, arg2);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
rl_forced_update_display ();
|
||||
}
|
||||
|
||||
void
|
||||
_rl_errmsg (format, arg1, arg2)
|
||||
char *format;
|
||||
{
|
||||
fprintf (stderr, "readline: ");
|
||||
fprintf (stderr, format, arg1, arg2);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
#endif /* !USE_VARARGS */
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* String Utility Functions */
|
||||
@@ -321,7 +272,8 @@ _rl_errmsg (format, arg1, arg2)
|
||||
char *
|
||||
_rl_strindex (const char *s1, const char *s2)
|
||||
{
|
||||
register int i, l, len;
|
||||
int i;
|
||||
size_t l, len;
|
||||
|
||||
for (i = 0, l = strlen (s2), len = strlen (s1); (len - i) >= l; i++)
|
||||
if (_rl_strnicmp (s1 + i, s2, l) == 0)
|
||||
@@ -329,9 +281,10 @@ _rl_strindex (const char *s1, const char *s2)
|
||||
return ((char *)NULL);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRPBRK
|
||||
#if !defined (HAVE_STRPBRK) || defined (HANDLE_MULTIBYTE)
|
||||
/* Find the first occurrence in STRING1 of any character from STRING2.
|
||||
Return a pointer to the character in STRING1. */
|
||||
Return a pointer to the character in STRING1. Understands multibyte
|
||||
characters. */
|
||||
char *
|
||||
_rl_strpbrk (const char *string1, const char *string2)
|
||||
{
|
||||
@@ -417,6 +370,48 @@ _rl_stricmp (const char *string1, const char *string2)
|
||||
}
|
||||
#endif /* !HAVE_STRCASECMP */
|
||||
|
||||
/* Compare the first N characters of S1 and S2 without regard to case. If
|
||||
FLAGS&1, apply the mapping specified by completion-map-case and make
|
||||
`-' and `_' equivalent. Returns 1 if the strings are equal. */
|
||||
int
|
||||
_rl_strcaseeqn(const char *s1, const char *s2, size_t n, int flags)
|
||||
{
|
||||
int c1, c2;
|
||||
int d;
|
||||
|
||||
if ((flags & 1) == 0)
|
||||
return (_rl_strnicmp (s1, s2, n) == 0);
|
||||
|
||||
do
|
||||
{
|
||||
c1 = _rl_to_lower (*s1);
|
||||
c2 = _rl_to_lower (*s2);
|
||||
|
||||
d = c1 - c2;
|
||||
if ((*s1 == '-' || *s1 == '_') && (*s2 == '-' || *s2 == '_'))
|
||||
d = 0; /* case insensitive character mapping */
|
||||
if (d != 0)
|
||||
return 0;
|
||||
s1++;
|
||||
s2++;
|
||||
n--;
|
||||
}
|
||||
while (n != 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return 1 if the characters C1 and C2 are equal without regard to case.
|
||||
If FLAGS&1, apply the mapping specified by completion-map-case and make
|
||||
`-' and `_' equivalent. */
|
||||
int
|
||||
_rl_charcasecmp (int c1, int c2, int flags)
|
||||
{
|
||||
if ((flags & 1) && (c1 == '-' || c1 == '_') && (c2 == '-' || c2 == '_'))
|
||||
return 1;
|
||||
return ( _rl_to_lower (c1) == _rl_to_lower (c2));
|
||||
}
|
||||
|
||||
/* Stupid comparison routine for qsort () ing strings. */
|
||||
int
|
||||
_rl_qsort_string_compare (char **s1, char **s2)
|
||||
@@ -464,28 +459,14 @@ _rl_savestring (const char *s)
|
||||
}
|
||||
|
||||
#if defined (DEBUG)
|
||||
#if defined (USE_VARARGS)
|
||||
static FILE *_rl_tracefp;
|
||||
|
||||
void
|
||||
#if defined (PREFER_STDARG)
|
||||
_rl_trace (const char *format, ...)
|
||||
#else
|
||||
_rl_trace (va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list args;
|
||||
#if defined (PREFER_VARARGS)
|
||||
char *format;
|
||||
#endif
|
||||
|
||||
#if defined (PREFER_STDARG)
|
||||
va_start (args, format);
|
||||
#else
|
||||
va_start (args);
|
||||
format = va_arg (args, char *);
|
||||
#endif
|
||||
|
||||
if (_rl_tracefp == 0)
|
||||
_rl_tropen ();
|
||||
@@ -531,7 +512,6 @@ _rl_settracefp (FILE *fp)
|
||||
{
|
||||
_rl_tracefp = fp;
|
||||
}
|
||||
#endif
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user