]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Fixes for compilation problems on Solaris(!).
[wxWidgets.git] / src / common / filefn.cpp
index af885044bd1073ba3e1e821032eef72b69ec444d..e9f0c9105f84294c2fb7b0ac5d71d0c89a7c556d 100644 (file)
@@ -75,6 +75,7 @@
 #endif
 
 #include "wx/setup.h"
+#include "wx/log.h"
 
 // No, Cygwin doesn't appear to have fnmatch.h after all.
 #if defined(HAVE_FNMATCH_H)
@@ -173,7 +174,8 @@ wxString wxPathList::FindValidPath (const wxString& file)
   char buf[_MAXPATHLEN];
   strcpy(buf, wxBuffer);
 
-  char *filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (char *)buf;
+  char *filename = (char*) NULL; /* shut up buggy egcs warning */
+  filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (char *)buf;
 
   for (wxNode * node = First (); node; node = node->Next ())
     {
@@ -240,7 +242,7 @@ wxFileExists (const wxString& filename)
 #else
   struct stat stbuf;
 
-  if (filename && stat ((char *)(const char *)filename, &stbuf) == 0)
+  if ((filename != "") && stat ((char *)(const char *)filename, &stbuf) == 0)
     return TRUE;
   return FALSE;
 #endif
@@ -581,8 +583,8 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
       strncmp(dest, val, len) == 0)
     {
       strcpy(wxBuffer, "~");
-      if (user && *user)
-       strcat(wxBuffer, user);
+      if (user != "")
+            strcat(wxBuffer, (const char*) user);
 #ifdef __WXMSW__
 //      strcat(wxBuffer, "\\");
 #else
@@ -1091,7 +1093,7 @@ char *wxGetTempFileName(const wxString& prefix, char *buf)
          return buf;
        }
     }
-  cerr << _("wxWindows: error finding temporary file name.\n");
+  wxLogError( _("wxWindows: error finding temporary file name.\n") );
   if (buf) buf[0] = 0;
   return (char *) NULL;
 #endif