INT8 *InfName\r
);\r
\r
+static \r
+void\r
+ReplaceSlash (\r
+ INT8 *Path\r
+ );\r
+\r
/*****************************************************************************/\r
int\r
main (\r
// added local symbols\r
//\r
ExpandSymbols (ArgLine, Line, sizeof (Line), EXPANDMODE_NO_UNDEFS);\r
-\r
+ \r
//\r
// If we have "c:\path\filename"\r
//\r
+ ReplaceSlash (Line);\r
if (IsAbsolutePath (Line)) {\r
ComponentFilePathAbsolute = 1;\r
} else if (Line[0] == '.') {\r
//\r
strcpy (ComponentFilePath, Line);\r
Cptr = ComponentFilePath + strlen (ComponentFilePath) - 1;\r
- while ((*Cptr != '\\') && (*Cptr != '/') && (Cptr != ComponentFilePath)) {\r
+ while ((*Cptr != '\\') && (Cptr != ComponentFilePath)) {\r
Cptr--;\r
}\r
//\r
// They may have defined DEST_DIR on the component INF line, so it's already\r
// been defined, If that's the case, then don't set it to the path of this file.\r
//\r
- if (GetSymbolValue (DEST_DIR) == NULL) {\r
+ TempCptr = GetSymbolValue (DEST_DIR);\r
+ if (TempCptr == NULL) {\r
if (ComponentFilePathAbsolute == 0) {\r
//\r
// The destination path is $(BUILD_DIR)\$(PROCESSOR)\component_path\r
);\r
}\r
AddSymbol (DEST_DIR, FileName, SYM_OVERWRITE | SYM_LOCAL | SYM_FILEPATH);\r
+ } else {\r
+ ReplaceSlash (TempCptr);\r
}\r
\r
//\r
//\r
OverridePath = GetSymbolValue (SOURCE_OVERRIDE_PATH);\r
if (OverridePath != NULL) {\r
+ ReplaceSlash (OverridePath);\r
fprintf (MakeFptr, "INC = $(INC) -I %s\n", OverridePath);\r
fprintf (MakeFptr, "INC = $(INC) -I %s\\%s \n", OverridePath, Processor);\r
}\r
// Don't process blank lines\r
//\r
if (*Cptr) {\r
+ ReplaceSlash (Cptr);\r
//\r
// Strip off trailing slash\r
//\r
//\r
ExpandSymbols (Cptr, FileName, sizeof (FileName), 0);\r
AddFileSymbols (FileName);\r
+ ReplaceSlash (FileName);\r
//\r
// Set the SOURCE_FILE_NAME symbol. What we have now is the name of\r
// the file, relative to the location of the INF file. So prepend\r
OverridePath = GetSymbolValue (SOURCE_OVERRIDE_PATH);\r
}\r
if (OverridePath != NULL) {\r
+ ReplaceSlash (OverridePath);\r
//\r
// See if the file exists. If it does, reset the SOURCE_FILE_NAME symbol.\r
//\r
//\r
if (!IsIncludeFile (Cptr)) {\r
ExpandSymbols (Cptr, FileName, sizeof (FileName), 0);\r
+ ReplaceSlash (FileName);\r
Cptr2 = BuiltFileExtension (FileName);\r
if (Cptr2 != NULL) {\r
SetFileExtension (FileName, Cptr2);\r
//\r
ExpandSymbols (Cptr, FileName, sizeof (FileName), 0);\r
AddFileSymbols (FileName);\r
+ ReplaceSlash (FileName);\r
if (IsIncludeFile (FileName)) {\r
if ((OverridePath != NULL) && (!IsAbsolutePath (FileName))) {\r
+ ReplaceSlash (OverridePath);\r
strcpy (TempFileName, OverridePath);\r
strcat (TempFileName, "\\");\r
strcat (TempFileName, FileName);\r
// to the beginning of the list of include paths.\r
//\r
for (Cptr = TempFileName + strlen (TempFileName) - 1;\r
- (Cptr >= TempFileName) && (*Cptr != '\\') && (*Cptr != '/');\r
+ (Cptr >= TempFileName) && (*Cptr != '\\');\r
Cptr--\r
)\r
;\r
FP->Extension[0] = 0;\r
}\r
//\r
- // Now back up and get the base name (include the preceding '\' or '/')\r
+ // Now back up and get the base name (include the preceding '\')\r
//\r
- for (; (Cptr > FileNamePtr) && (*Cptr != '\\') && (*Cptr != '/'); Cptr--)\r
+ for (; (Cptr > FileNamePtr) && (*Cptr != '\\'); Cptr--)\r
;\r
FP->BaseName = (char *) malloc (strlen (Cptr) + 1);\r
strcpy (FP->BaseName, Cptr);\r
}\r
\r
for (;;) {\r
- for (; *Cptr && (*Cptr != '/') && (*Cptr != '\\'); Cptr++)\r
+ for (; *Cptr && (*Cptr != '\\'); Cptr++)\r
;\r
if (*Cptr) {\r
SavedChar = *Cptr;\r
FreeCwd = 1;\r
AddSymbol (BUILD_DIR, Cptr, SYM_OVERWRITE | SYM_GLOBAL | SYM_FILEPATH);\r
} else {\r
+ ReplaceSlash (Cptr);\r
FreeCwd = 0;\r
}\r
\r
//\r
EfiSource = GetSymbolValue (EFI_SOURCE);\r
if ( EfiSource != NULL) {\r
+ ReplaceSlash (EfiSource);\r
if (EfiSource[strlen (EfiSource) - 1] == '\\') {\r
EfiSource[strlen (EfiSource) - 1] = 0;\r
} \r
//\r
EfiSource = getenv (EFI_SOURCE);\r
if (EfiSource != NULL) {\r
+ ReplaceSlash (EfiSource);\r
if (EfiSource[strlen (EfiSource) - 1] == '\\') {\r
EfiSource[strlen (EfiSource) - 1] = 0;\r
}\r
return 0;\r
}\r
\r
+ \r
+static \r
+void\r
+ReplaceSlash (\r
+ INT8 *Path\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Replace '/' with '\\'\r
+\r
+Returns:\r
+\r
+--*/\r
+{\r
+ while (*Path) {\r
+ if (*Path == '/') {\r
+ *Path = '\\';\r
+ }\r
+ Path++;\r
+ }\r
+}
\ No newline at end of file