(win32 console apps)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9854
dc483132-0cff-0310-8789-
dd5450dbe970
+Tue Feb 11 13:31:49 1997 Richard Basch <basch@lehman.com>
+
+ * com_err.c: If the application is a console application, simply
+ display the message to stderr. (win32)
+
Mon Feb 10 21:30:41 1997 Theodore Y. Ts'o <tytso@mit.edu>
* com_err.c, com_err.h (com_err_va): Fix broken Windows 16
#include "com_err.h"
#include "error_table.h"
+#if defined(_MSDOS) || defined(_WIN32)
+#include <io.h>
+#endif
#ifdef _MACINTOSH
#include "icons.h"
static void MacMessageBox(errbuf);
MacMessageBox(errbuf);
#else
/* For Windows */
- MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION);
+ if (_isatty(_fileno(stderr))) {
+ fputs(errbuf, stderr);
+ fputc('\r', stderr);
+ fputc('\n', stderr);
+ fflush(stderr);
+ } else
+ MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION);
#endif
}
#endif