diff --git a/check.t b/check.t index 70ba9bd..8d4a257 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.241 2008/11/09 20:32:16 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.242 2008/11/10 19:33:07 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -7,7 +7,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R36 2008/11/09 + @(#)MIRBSD KSH R36 2008/11/10 description: Check version of shell. stdin: diff --git a/main.c b/main.c index a17778a..0778c08 100644 --- a/main.c +++ b/main.c @@ -13,7 +13,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.105 2008/10/28 14:32:41 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.106 2008/11/10 19:33:07 tg Exp $"); extern char **environ; @@ -792,7 +792,7 @@ errorf(const char *fmt, ...) shl_stdout_ok = 0; /* debugging: note that stdout not valid */ exstat = 1; - if (*fmt) { + if (*fmt != 1) { error_prefix(true); va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); @@ -827,7 +827,7 @@ bi_errorf(const char *fmt, ...) shl_stdout_ok = 0; /* debugging: note that stdout not valid */ exstat = 1; - if (*fmt) { + if (*fmt != 1) { error_prefix(true); /* not set when main() calls parse_args() */ if (builtin_argv0) diff --git a/sh.h b/sh.h index 31f9757..3b8f510 100644 --- a/sh.h +++ b/sh.h @@ -103,9 +103,9 @@ #define __SCCSID(x) __IDSTRING(sccsid,x) #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.251 2008/11/09 20:32:18 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.252 2008/11/10 19:33:08 tg Exp $"); #endif -#define MKSH_VERSION "R36 2008/11/09" +#define MKSH_VERSION "R36 2008/11/10" #ifndef MKSH_INCLUDES_ONLY @@ -516,7 +516,7 @@ EXTERN char shell_flags[FNFLAGS]; /* null value for variable; comparision pointer for unset */ EXTERN char null[] I__(""); /* helpers for string pooling */ -EXTERN const char T_synerr[] I__("syntax error"); +#define T_synerr "syntax error" enum temp_type { TT_HEREDOC_EXP, /* expanded heredoc */ @@ -1411,18 +1411,8 @@ void warningf(bool, const char *, ...) __attribute__((format (printf, 2, 3))); void bi_errorf(const char *, ...) __attribute__((format (printf, 1, 2))); -/* - * circumvent compiler format string nonnull checking - * we teach xlC to not bitch about zero-lengths, want - * gcc to do it, and so gain double-checking benefits - */ -#if defined(__xlC__) -#define errorfz() errorf("") -#define bi_errorfz() bi_errorf("") -#else -#define errorfz() errorf(null) -#define bi_errorfz() bi_errorf(null) -#endif +#define errorfz() errorf("\1") +#define bi_errorfz() bi_errorf("\1") void internal_errorf(const char *, ...) __attribute__((noreturn)) __attribute__((format (printf, 1, 2)));