From: Thorsten Engel Date: Sat, 7 May 2005 23:42:14 +0000 (+0000) Subject: utf-8 support on win32 by replacing fputs and fgets X-Git-Tag: Release-7.0.0~8817 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d6e667edd76cda99c756313b59ae6e9b432c7018;p=bacula%2Fbacula utf-8 support on win32 by replacing fputs and fgets git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2008 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index bdc0cc3431..f793b5030c 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -44,8 +44,8 @@ #ifdef HAVE_WIN32 #include +#include "../lib/winapi.h" #define isatty(fd) (fd==0) -DWORD g_platform_id = VER_PLATFORM_WIN32_WINDOWS; #endif /* Exported variables */ @@ -380,7 +380,10 @@ int main(int argc, char *argv[]) signal(SIGTTIN, got_sigtin); signal(SIGTTOU, got_sigtout); trapctlc(); +#else + InitWinAPIWrapper(); #endif + if (argc) { usage(); @@ -715,9 +718,18 @@ again: input_line(sock->msg, len); break; } +#endif +#ifdef HAVE_WIN32 /* use special console for input on win32 */ + if (input == stdin) { + if (win32_cgets(sock->msg, len) == NULL) { + return -1; + } + } + else #endif if (fgets(sock->msg, len, input) == NULL) { return -1; + } break; } @@ -870,6 +882,7 @@ void sendit(const char *buf) fputs(buf, output); } #else + fputs(buf, output); fflush(output); if (tee) {