commit bash-20190328 snapshot

This commit is contained in:
Chet Ramey
2019-04-01 15:44:20 -04:00
parent 31321bf1b2
commit befdddcbf1
30 changed files with 462 additions and 61 deletions
+2 -26
View File
@@ -149,7 +149,7 @@ extern int errno;
if (vflag) \
{ \
SHELL_VAR *v; \
v = bind_printf_variable (vname, vbuf, 0); \
v = builtin_bind_variable (vname, vbuf, 0); \
stupidly_hack_special_variables (vname); \
if (v == 0 || readonly_p (v) || noassign_p (v)) \
return (EXECUTION_FAILURE); \
@@ -206,7 +206,6 @@ 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;
@@ -301,7 +300,7 @@ printf_builtin (list)
if (vflag && list->word->word && list->word->word[0] == '\0')
{
SHELL_VAR *v;
v = bind_printf_variable (vname, "", 0);
v = builtin_bind_variable (vname, "", 0);
stupidly_hack_special_variables (vname);
return ((v == 0 || readonly_p (v) || noassign_p (v)) ? EXECUTION_FAILURE : EXECUTION_SUCCESS);
}
@@ -1271,26 +1270,3 @@ asciicode ()
garglist = garglist->next;
return (ch);
}
static SHELL_VAR *
bind_printf_variable (name, value, flags)
char *name;
char *value;
int flags;
{
SHELL_VAR *v;
#if defined (ARRAY_VARS)
if (valid_array_reference (name, assoc_expand_once ? (VA_NOEXPAND|VA_ONEWORD) : 0) == 0)
v = bind_variable (name, value, flags);
else
v = assign_array_element (name, value, flags | (assoc_expand_once ? ASS_NOEXPAND : 0));
#else /* !ARRAY_VARS */
v = bind_variable (name, value, flags);
#endif /* !ARRAY_VARS */
if (v && readonly_p (v) == 0 && noassign_p (v) == 0)
VUNSETATTR (v, att_invisible);
return v;
}