ICU-22204 toolutil: Fix crash when trying to generate MinGW assembly

This commit is contained in:
L. E. Segovia 2022-11-16 19:16:08 -03:00 committed by Markus Scherer
parent b6b7b045e9
commit e7aad77f31

View file

@ -315,12 +315,11 @@ writeAssemblyCode(
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
uprv_strcpy(outFilePath, buffer.chars);
}
#if defined (WINDOWS_WITH_GNUC) && U_PLATFORM != U_PF_CYGWIN
/* Need to fix the file separator character when using MinGW. */
swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/');
/* Need to fix the file separator character when using MinGW. */
swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/');
#endif
}
if(optEntryPoint != NULL) {
uprv_strcpy(entry, optEntryPoint);
@ -433,6 +432,10 @@ writeCCode(
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
uprv_strcpy(outFilePath, buffer);
#if defined (WINDOWS_WITH_GNUC) && U_PLATFORM != U_PF_CYGWIN
/* Need to fix the file separator character when using MinGW. */
swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/');
#endif
}
out=T_FileStream_open(buffer, "w");