Skip to content

Commit

Permalink
ICU-22204 toolutil: Fix crash when trying to generate MinGW assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
amyspark authored and markusicu committed Dec 2, 2022
1 parent b6b7b04 commit e7aad77
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions icu4c/source/tools/toolutil/pkg_genc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit e7aad77

Please sign in to comment.