]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20120413 snapshot
authorChet Ramey <chet.ramey@case.edu>
Wed, 2 May 2012 12:25:44 +0000 (08:25 -0400)
committerChet Ramey <chet.ramey@case.edu>
Wed, 2 May 2012 12:25:44 +0000 (08:25 -0400)
CWRU/CWRU.chlog
lib/readline/colors.h
lib/readline/parse-colors.c
lib/readline/parse-colors.h
lib/sh/snprintf.c
support/shobj-conf
trap.c

index dbfa228994e535c67d2004534ebc439aa63ddcbb..0be33a906d17f18a30cbbe2404a426b498650a5a 100644 (file)
@@ -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
          <wooledg@eeg.ccf.org>
+
+                                  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 <stdbool.h> 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 <petr.sumbera@sun.com>
index 7ea60e1c48da4ea0d0a328bdc679d83442008b2b..cd217e422ed7f4bafe392b2de90dabfa4f113976 100644 (file)
 #define _COLORS_H_
 
 #include <stdio.h> // size_t
-#include <stdbool.h> // bool
+
+#if defined (HAVE_STDBOOL_H)
+#  include <stdbool.h> // 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
index f66a8cbc2b023da5c7b0bdf06aafca64691097b2..06eb25aca881ddb7c42d59f5e3f73fa550e2b63c 100644 (file)
 #  include "ansi_stdlib.h"
 #endif /* HAVE_STDLIB_H */
 
-#if defined (HAVE_STDBOOL_H)
-#  include <stdbool.h> // 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 {
index 2a7198aa626828f97360a18d1bedb10a010a962d..aef86f784d45d519cc3a2b6f69eafd30a550dff8 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef _PARSE_COLORS_H_
 #define _PARSE_COLORS_H_
 
-#include <stdbool.h> // bool
 #include "readline.h"
 
 #define LEN_STR_PAIR(s) sizeof (s) - 1, s
index ac82d849915ccd67cd8c866629bfdbcdbd056eb6..8df16cc28967625c2f2799effd6cecaa7eaee03d 100644 (file)
@@ -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':
index 3b51265bc74d1eb0637a368b369f319801255216..e82be7e38a2333fe80630cac73d1a43746124fed 100644 (file)
@@ -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 d8941b006645e4de191fd55ed86917aa3fc104a3..583a1f69a514e0f6e3d457e94ffbe4452dfc0aa6 100644 (file)
--- 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)