]> git.sur5r.net Git - bacula/bacula/commitdiff
Correct a minor build problem with wx-console.
authorKern Sibbald <kern@sibbald.com>
Tue, 10 May 2005 13:45:01 +0000 (13:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 10 May 2005 13:45:01 +0000 (13:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2022 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.cpp
bacula/src/wx-console/console_thread.cpp
bacula/src/wx-console/wxbutils.cpp

index 481ff2e375efd646ce411226289d9cea2c6da7f5..96c21319601df516948bf35a5e43098ab0e8d7ed 100644 (file)
@@ -954,30 +954,21 @@ win32_cgets (char* buffer, int len)
    if ((g_platform_id == VER_PLATFORM_WIN32_NT) && p_WideCharToMultiByte && p_cgetws) {      
       WCHAR szBuf[260];
       szBuf[0] = min (255, len); /* max len, must be smaller than buffer */
-      if (!p_cgetws (szBuf))
-         return NULL;
-
-      if (wchar_2_UTF8(buffer, &szBuf[2], len))
+      if (p_cgetws(szBuf) && wchar_2_UTF8(buffer, &szBuf[2], len))
          return buffer;
-      else
-         return NULL;
    }
 
    /* win 9x and unicode conversion */
    if ((g_platform_id == VER_PLATFORM_WIN32_WINDOWS) && p_WideCharToMultiByte && p_MultiByteToWideChar) {
       char szBuf[260];
-      szBuf[0] = min (255, len); /* max len, must be smaller than buffer */
-      if (!_cgets (szBuf))
-         return NULL;
-
-      /* back and forth to get UTF-8 from ANSI */
-      WCHAR wszBuf[260];
-      p_MultiByteToWideChar(CP_OEMCP, 0, &szBuf[2], -1, wszBuf,260);
+      szBuf[0] = min(255, len); /* max len, must be smaller than buffer */
+      if (_cgets(szBuf)) {  
+         WCHAR wszBuf[260];
+         p_MultiByteToWideChar(CP_OEMCP, 0, &szBuf[2], -1, wszBuf,260);
 
-      if (wchar_2_UTF8(buffer, wszBuf, len))
-         return buffer;
-      else
-         return NULL;
+         if (wchar_2_UTF8(buffer, wszBuf, len))
+            return buffer;
+      }
    }
 
    /* fallback */
index 0c26b3e48b6bd054cc6a4db73f906159a569efca..b47bc35b11988648aec6cb96bbdacba68803a2c5 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index 0fbe93921a99ca7d59cb7114bd60ad55d0592d5d..b15cf58c1f38713241479141c0d29d0e36d78605 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License