summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2012-05-02 08:25:44 -0400
committerChet Ramey <chet.ramey@case.edu>2012-05-02 08:25:44 -0400
commit63817e33cd87b8a51e0bb5ab2e61e2402b30bbe2 (patch)
tree297f0337f1820b1bf1403c2de79873d9c0103f12
parented3f3b6c22ca1b857991f40df39d6781a52596dc (diff)
downloadbash-63817e33cd87b8a51e0bb5ab2e61e2402b30bbe2.tar.gz
commit bash-20120413 snapshot
-rw-r--r--CWRU/CWRU.chlog16
-rw-r--r--lib/readline/colors.h18
-rw-r--r--lib/readline/parse-colors.c8
-rw-r--r--lib/readline/parse-colors.h1
-rw-r--r--lib/sh/snprintf.c11
-rw-r--r--support/shobj-conf2
-rw-r--r--trap.c3
7 files changed, 45 insertions, 14 deletions
diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog
index dbfa2289..0be33a90 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
<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>
diff --git a/lib/readline/colors.h b/lib/readline/colors.h
index 7ea60e1c..cd217e42 100644
--- a/lib/readline/colors.h
+++ b/lib/readline/colors.h
@@ -28,7 +28,23 @@
#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
diff --git a/lib/readline/parse-colors.c b/lib/readline/parse-colors.c
index f66a8cbc..06eb25ac 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 <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 {
diff --git a/lib/readline/parse-colors.h b/lib/readline/parse-colors.h
index 2a7198aa..aef86f78 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 <stdbool.h> // 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 ac82d849..8df16cc2 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 3b51265b..e82be7e3 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 d8941b00..583a1f69 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)