strcpy(IncludePaths[NumIncludePaths], sourcePath);\r
\r
// Not ending with directory delimiter?\r
- if(*(IncludePaths[NumIncludePaths] + strlen(IncludePaths[NumIncludePaths]) - 1) != DIRECTORY_DELIMITER_CHAR)\r
+ if(!MS_IsDirectoryDelimiter(*(IncludePaths[NumIncludePaths] + strlen(IncludePaths[NumIncludePaths]) - 1)))\r
{\r
// Add a directory delimiter to the include path\r
- strcat(IncludePaths[NumIncludePaths], DIRECTORY_DELIMITER);\r
+ strcat(IncludePaths[NumIncludePaths], "/");\r
}\r
NumIncludePaths++;\r
}\r
{\r
IncludePaths[0][0] = 0;\r
}\r
- else\r
- {\r
- // Add a directory delimiter to the include path\r
- strcat(IncludePaths[0], DIRECTORY_DELIMITER);\r
- }\r
}\r
\r
\r
// Handle absolute paths\r
if(MS_IsPathAbsolute(fileName))\r
{\r
+#if defined(_WIN32) || defined(__MSDOS__)\r
+ sourceName[0] = '\0';\r
+ if(MS_IsDirectoryDelimiter(fileName[0]))\r
+ {\r
+ // The source file is absolute for the drive, but does not\r
+ // specify a drive. Use the path for the current file to\r
+ // get the drive letter, if it has one.\r
+ if(IncludePaths[0][0] != '\0' && IncludePaths[0][1] == ':')\r
+ {\r
+ sourceName[0] = IncludePaths[0][0];\r
+ sourceName[1] = ':';\r
+ sourceName[2] = '\0';\r
+ }\r
+ }\r
+ strcat(sourceName, fileName);\r
+#else\r
strcpy(sourceName, fileName);\r
+#endif\r
foundfile = MS_FileExists(sourceName);\r
}\r
else\r
ERR_ErrorAt(tk_SourceName, tk_Line);\r
ERR_Exit(ERR_CANT_FIND_INCLUDE, YES, fileName, tk_SourceName, tk_Line);\r
}\r
- \r
+\r
+ MS_Message(MSG_DEBUG, "*Include file found at %s\n", sourceName);\r
+\r
// Now change the first include path to the file directory\r
SetLocalIncludePath(sourceName);\r
\r
*text++ = Chr;\r
}\r
// escape the character after a backslash [JB]\r
- if(Chr == ASCII_BACKSLASH)\r
- escaped ^= (Chr == ASCII_BACKSLASH);\r
+ if(Chr == '\\')\r
+ escaped ^= (Chr == '\\');\r
else\r
escaped = FALSE;\r
NextChr();\r