Do locale swapping in the warning()/error() macros themselves instead

of in the underlying functions.
This commit is contained in:
Todd C. Miller
2012-11-25 09:34:15 -05:00
parent 4bde57b8b2
commit 88c6446daf
3 changed files with 130 additions and 36 deletions

View File

@@ -33,7 +33,7 @@ static void _warning(int, const char *, va_list);
void cleanup(int);
void
error_nodebug(int eval, const char *fmt, ...)
error2(int eval, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -44,7 +44,7 @@ error_nodebug(int eval, const char *fmt, ...)
}
void
errorx_nodebug(int eval, const char *fmt, ...)
errorx2(int eval, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -55,7 +55,7 @@ errorx_nodebug(int eval, const char *fmt, ...)
}
void
verror_nodebug(int eval, const char *fmt, va_list ap)
verror2(int eval, const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
cleanup(0);
@@ -63,7 +63,7 @@ verror_nodebug(int eval, const char *fmt, va_list ap)
}
void
verrorx_nodebug(int eval, const char *fmt, va_list ap)
verrorx2(int eval, const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
cleanup(0);
@@ -71,7 +71,7 @@ verrorx_nodebug(int eval, const char *fmt, va_list ap)
}
void
warning_nodebug(const char *fmt, ...)
warning2(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -80,7 +80,7 @@ warning_nodebug(const char *fmt, ...)
}
void
warningx_nodebug(const char *fmt, ...)
warningx2(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -89,13 +89,13 @@ warningx_nodebug(const char *fmt, ...)
}
void
vwarning_nodebug(const char *fmt, va_list ap)
vwarning2(const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
}
void
vwarningx_nodebug(const char *fmt, va_list ap)
vwarningx2(const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
}
@@ -116,3 +116,16 @@ _warning(int use_errno, const char *fmt, va_list ap)
}
putc('\n', stderr);
}
/* No need to swap locales in the front end. */
void
warning_set_locale(void)
{
return;
}
void
warning_restore_locale(void)
{
return;
}