]> git.sur5r.net Git - bacula/bacula/commitdiff
utf-8 support on win32 by replacing fputs and fgets
authorThorsten Engel <thorsten.engel@matrix-computer.com>
Sat, 7 May 2005 23:42:14 +0000 (23:42 +0000)
committerThorsten Engel <thorsten.engel@matrix-computer.com>
Sat, 7 May 2005 23:42:14 +0000 (23:42 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2008 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/console/console.c

index bdc0cc3431528498924d901fb448adf4b704d01d..f793b5030cc03a781c13025dfecfabad9bfe34cf 100644 (file)
@@ -44,8 +44,8 @@
 
 #ifdef HAVE_WIN32
 #include <windows.h>
+#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) {