summaryrefslogtreecommitdiff
path: root/src/kash/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kash/error.c')
-rw-r--r--src/kash/error.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/kash/error.c b/src/kash/error.c
index aa7d39c..7afa91f 100644
--- a/src/kash/error.c
+++ b/src/kash/error.c
@@ -137,7 +137,7 @@ exvwarning(shinstance *psh, int sv_errno, const char *msg, va_list ap)
outfmt(&psh->errout, ": ");
}
if (sv_errno >= 0)
- outfmt(&psh->errout, "%s", strerror(sv_errno));
+ outfmt(&psh->errout, "%s", sh_strerror(psh, sv_errno));
out2c(psh, '\n');
flushout(&psh->errout);
}
@@ -155,8 +155,15 @@ exverror(shinstance *psh, int cond, const char *msg, va_list ap)
#ifdef DEBUG
if (msg) {
+ va_list va2;
TRACE((psh, "exverror(%d, \"", cond));
- TRACEV((psh, msg, ap));
+# ifdef va_copy /* MSC 2010 still doesn't have va_copy. sigh. */
+ va_copy(va2, ap);
+# else
+ va2 = ap;
+# endif
+ TRACEV((psh, msg, va2));
+ va_end(va2);
TRACE((psh, "\") pid=%d\n", sh_getpid(psh)));
} else
TRACE((psh, "exverror(%d, NULL) pid=%d\n", cond, sh_getpid(psh)));