]> granicus.if.org Git - icu/commitdiff
ICU-22204 toolutil: Fix crash when trying to generate MinGW assembly cldr/2022-12-02
authorL. E. Segovia <amy@amyspark.me>
Wed, 16 Nov 2022 22:16:08 +0000 (19:16 -0300)
committerMarkus Scherer <markus.icu@gmail.com>
Fri, 2 Dec 2022 18:42:24 +0000 (10:42 -0800)
icu4c/source/tools/toolutil/pkg_genc.cpp

index 1f81bf94a42dde774b7444b7c7974fcca903e044..4dab597da5d377d5c5df156cb234664e00991e83 100644 (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");