]> git.sur5r.net Git - cc65/blobdiff - src/cc65/incpath.c
Fixed a bug
[cc65] / src / cc65 / incpath.c
index 2776099b867c7ab1fdcafe1ed0620cc2ba9ccb4d..767ad2a86e7b4832b81dd4e6b2f74a18536ea3cd 100644 (file)
 #if defined(_MSC_VER)
 /* Microsoft compiler */
 #  include <io.h>
-#  define R_OK 4
 #else
 /* Anyone else */
 #  include <unistd.h>
 #endif
 
-#include "../common/xmalloc.h"
+/* common */
+#include "xmalloc.h"
 
+/* cc65 */
 #include "incpath.h"
 
 
@@ -85,7 +86,7 @@ static char* Add (char* Orig, const char* New)
     }
 
     /* Allocate memory for the new string */
-    NewPath = xmalloc (OrigLen + NewLen + 2);
+    NewPath = (char*) xmalloc (OrigLen + NewLen + 2);
 
     /* Copy the strings */
     memcpy (NewPath, Orig, OrigLen);
@@ -138,7 +139,7 @@ static char* Find (const char* Path, const char* File)
        strcpy (PathName + Count, File);
 
        /* Check if this file exists */
-       if (access (PathName, R_OK) == 0) {
+       if (access (PathName, 0) == 0) {
            /* The file exists */
            return xstrdup (PathName);
        }