From: Chet Ramey Date: Wed, 2 May 2012 12:25:44 +0000 (-0400) Subject: commit bash-20120413 snapshot X-Git-Tag: bash-4.3-alpha~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63817e33cd87b8a51e0bb5ab2e61e2402b30bbe2;p=thirdparty%2Fbash.git commit bash-20120413 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index dbfa22899..0be33a906 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -13702,3 +13702,19 @@ doc/{bash.1,bashref.texi} any shell with history enabled, not just interactive shells. This seems to be more logical behavior. Suggested by Greg Wooledge + + 4/12 + ---- +lib/readline/colors.h + - only include stdbool.h if HAVE_STDBOOL_H is defined + - if HAVE_STDBOOL_H is not defined, provide enough definition for the + library to use `bool', `true', and `false' + +lib/readline/parse-colors.[ch] + - don't try to include at all; rely on colors.h to do it + +lib/sh/snprintf.c + - vsnprintf_internal: only treat '0' as a flag to indicate zero padding + if `.' hasn't been encountered ((flags&PF_DOT) == 0); otherwise treat + it as the first digit of a precision specifier. Fixes bug reported + by Petr Sumbera diff --git a/lib/readline/colors.h b/lib/readline/colors.h index 7ea60e1c4..cd217e422 100644 --- a/lib/readline/colors.h +++ b/lib/readline/colors.h @@ -28,7 +28,23 @@ #define _COLORS_H_ #include // size_t -#include // bool + +#if defined (HAVE_STDBOOL_H) +# include // bool +#else +typedef int _rl_bool_t; + +#ifdef bool +# undef bool +#endif +#define bool _rl_bool_t + +#ifndef true +# define true 1 +# define false 0 +#endif + +#endif /* !HAVE_STDBOOL_H */ /* Null is a valid character in a color indicator (think about Epson printers, for example) so we have to use a length/buffer string diff --git a/lib/readline/parse-colors.c b/lib/readline/parse-colors.c index f66a8cbc2..06eb25aca 100644 --- a/lib/readline/parse-colors.c +++ b/lib/readline/parse-colors.c @@ -46,10 +46,6 @@ # include "ansi_stdlib.h" #endif /* HAVE_STDLIB_H */ -#if defined (HAVE_STDBOOL_H) -# include // bool -#endif - #include "rldefs.h" // STREQ, savestring #include "readline.h" #include "rlprivate.h" @@ -104,8 +100,8 @@ struct bin_str _rl_color_indicator[] = the first free byte after the array and the character that ended the input string, respectively. */ -static -bool get_funky_string (char **dest, const char **src, bool equals_end, size_t *output_count) { +static bool +get_funky_string (char **dest, const char **src, bool equals_end, size_t *output_count) { char num; /* For numerical codes */ size_t count; /* Something to count with */ enum { diff --git a/lib/readline/parse-colors.h b/lib/readline/parse-colors.h index 2a7198aa6..aef86f784 100644 --- a/lib/readline/parse-colors.h +++ b/lib/readline/parse-colors.h @@ -27,7 +27,6 @@ #ifndef _PARSE_COLORS_H_ #define _PARSE_COLORS_H_ -#include // bool #include "readline.h" #define LEN_STR_PAIR(s) sizeof (s) - 1, s diff --git a/lib/sh/snprintf.c b/lib/sh/snprintf.c index ac82d8499..8df16cc28 100644 --- a/lib/sh/snprintf.c +++ b/lib/sh/snprintf.c @@ -1288,10 +1288,6 @@ vsnprintf_internal(data, string, length, format, args) case '#': data->flags |= PF_ALTFORM; continue; - case '0': - data->flags |= PF_ZEROPAD; - data->pad = '0'; - continue; case '*': if (data->flags & PF_DOT) data->flags |= PF_STAR_P; @@ -1322,6 +1318,13 @@ vsnprintf_internal(data, string, length, format, args) data->flags |= PF_THOUSANDS; continue; + case '0': + if ((data->flags & PF_DOT) == 0) + { + data->flags |= PF_ZEROPAD; + data->pad = '0'; + continue; + } case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': diff --git a/support/shobj-conf b/support/shobj-conf index 3b51265bc..e82be7e38 100644 --- a/support/shobj-conf +++ b/support/shobj-conf @@ -67,7 +67,7 @@ done case "${host_os}-${SHOBJ_CC}-${host_vendor}" in nsk-cc-tandem) SHOBJ_CFLAGS=-Wglobalized - case $(uname -m) in + case `uname -m` in NSR*) SHOBJ_CFLAGS="${SHOBJ_CFLAGS} -Wcall_shared" # default on TNS/E, needed on TNS/R SHOBJ_LD=/usr/bin/ld # for TNS/R diff --git a/trap.c b/trap.c index d8941b006..583a1f69a 100644 --- a/trap.c +++ b/trap.c @@ -787,7 +787,8 @@ _run_trap_internal (sig, tag) { char *trap_command, *old_trap; int trap_exit_value, *token_state; - int save_return_catch_flag, function_code, flags; + volatile int save_return_catch_flag, function_code; + int flags; procenv_t save_return_catch; WORD_LIST *save_subst_varlist; #if defined (ARRAY_VARS)