save some space for error-less error messages

inspired by a bugfix for posh for something that was not a bug in here
This commit is contained in:
tg 2012-11-12 18:28:40 +00:00
parent bbc0702cdd
commit 222d50f1af
2 changed files with 6 additions and 6 deletions

4
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.237 2012/10/30 20:49:42 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.238 2012/11/12 18:28:39 tg Exp $");
extern char **environ;
@ -1138,7 +1138,7 @@ static void vwarningf(unsigned int, const char *, va_list)
static void
vwarningf(unsigned int flags, const char *fmt, va_list ap)
{
if (*fmt != 1) {
if (fmt) {
if (flags & VWARNINGF_INTERNAL)
shf_fprintf(shl_out, "internal error: ");
if (flags & VWARNINGF_ERRORPREFIX)

8
sh.h
View File

@ -157,7 +157,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.600 2012/10/30 20:49:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.601 2012/11/12 18:28:40 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/10/30"
@ -1826,9 +1826,9 @@ void warningf(bool, const char *, ...)
MKSH_A_FORMAT(__printf__, 2, 3);
void bi_errorf(const char *, ...)
MKSH_A_FORMAT(__printf__, 1, 2);
#define errorfz() errorf("\1")
#define errorfxz(rc) errorfx((rc), "\1")
#define bi_errorfz() bi_errorf("\1")
#define errorfz() errorf(NULL)
#define errorfxz(rc) errorfx((rc), NULL)
#define bi_errorfz() bi_errorf(NULL)
void internal_errorf(const char *, ...)
MKSH_A_NORETURN
MKSH_A_FORMAT(__printf__, 1, 2);