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>
#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
# 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"
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 {
#ifndef _PARSE_COLORS_H_
#define _PARSE_COLORS_H_
-#include <stdbool.h> // bool
#include "readline.h"
#define LEN_STR_PAIR(s) sizeof (s) - 1, s
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;
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':
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
{
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)