Bash-4.1 distribution source

This commit is contained in:
Chet Ramey 2011-11-21 20:51:19 -05:00
commit 0001803f0b
252 changed files with 51563 additions and 37176 deletions

View file

@ -135,7 +135,7 @@ extern int errno;
{ \
if (vflag) \
{ \
bind_variable (vname, vbuf, 0); \
bind_printf_variable (vname, vbuf, 0); \
stupidly_hack_special_variables (vname); \
} \
if (conv_bufsize > 4096 ) \
@ -156,6 +156,7 @@ extern int errno;
fflush (stdout); \
if (ferror (stdout)) \
{ \
sh_wrerror (); \
clearerr (stdout); \
return (EXECUTION_FAILURE); \
} \
@ -166,11 +167,11 @@ extern int errno;
#define SKIP1 "#'-+ 0"
#define LENMODS "hjlLtz"
#ifndef HAVE_ASPRINTF
#if !HAVE_ASPRINTF
extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
#endif
#ifndef HAVE_VSNPRINTF
#if !HAVE_VSNPRINTF
extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4)));
#endif
@ -186,6 +187,7 @@ static char *getstr __P((void));
static int getint __P((void));
static intmax_t getintmax __P((void));
static uintmax_t getuintmax __P((void));
static SHELL_VAR *bind_printf_variable __P((char *, char *, int));
#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && !defined(STRTOLD_BROKEN)
typedef long double floatmax_t;
@ -234,7 +236,12 @@ printf_builtin (list)
switch (ch)
{
case 'v':
if (legal_identifier (vname = list_optarg))
vname = list_optarg;
#if defined (ARRAY_VARS)
if (legal_identifier (vname) || valid_array_reference (vname))
#else
if (legal_identifier (vname))
#endif
{
vflag = 1;
vblen = 0;
@ -997,7 +1004,9 @@ getintmax ()
shall continue processing any remaining operands and shall write the
value accumulated at the time the error was detected to standard
output.'' Yecch. */
ret = 0;
#if 0
ret = 0; /* return partially-converted value from strtoimax */
#endif
conversion_error = 1;
}
else if (errno == ERANGE)
@ -1091,3 +1100,19 @@ asciicode ()
garglist = garglist->next;
return (ch);
}
static SHELL_VAR *
bind_printf_variable (name, value, flags)
char *name;
char *value;
int flags;
{
#if defined (ARRAY_VARS)
if (valid_array_reference (name) == 0)
return (bind_variable (name, value, flags));
else
return (assign_array_element (name, value, flags));
#else /* !ARRAY_VARS */
return bind_variable (name, value, flags);
#endif /* !ARRAY_VARS */
}