ecere; compiler/libec: (#234, #361) Fixed isblank issue with GCC 3.4.5
[sdk] / ecere / src / com / instance.c
index ad648fc..a9f3c25 100644 (file)
@@ -50,6 +50,10 @@ typedef unsigned long long uint64;
 #define MAX_FILENAME 274
 #define MAX_EXTENSION 17
 
+#if defined(__MINGW32__) && !defined(_W64) && __GNUC__ < 4
+__declspec(dllexport) int isblank(int c) { return c == '\t' || c == ' '; }
+#endif
+
 #if defined(__WIN32__)
 intptr_t stdinHandle, stdoutHandle;
 int osfStdin, osfStdout;
@@ -415,7 +419,8 @@ void Instance_COM_Initialize(int argc, char ** argv, char ** parsedCommand, int
 #if defined(__unix__)
    if(!__thisModule && argv)
    {
-      getcwd(exeLocation, MAX_LOCATION);
+      if(!getcwd(exeLocation, MAX_LOCATION))
+         exeLocation[0] = 0;
       PathCat(exeLocation, argv[0]);
    }
 #endif