Fix a bug in "crossgen /createpdb" command that can cause it to fail
if the input filename is given without a path.
Commit migrated from https://github.com/dotnet/coreclr/commit/
acd2bba2231e07f006846b44e790c5073d7c6019
if (!fileName.FindBack(iSimpleNameStart, DIRECTORY_SEPARATOR_CHAR_W))
{
+#ifdef CROSSGEN_COMPILE
+ iSimpleNameStart = fileName.Begin();
+#else
// Couldn't find a directory separator. File must have been specified as a relative path. Not allowed.
GO_WITH_HRESULT(E_INVALIDARG);
+#endif
+ }
+ else
+ {
+ // Advance past the directory separator to the first character of the file name
+ iSimpleNameStart++;
}
if (iSimpleNameStart == fileName.End())
GO_WITH_HRESULT(E_INVALIDARG);
}
- // Advance past the directory separator to the first character of the file name
- iSimpleNameStart++;
-
SString simpleName;
bool isNativeImage = false;