]> granicus.if.org Git - icu/commit
ICU-20545 Detect file separator char from dir
authorŁukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
Sat, 2 May 2020 09:39:21 +0000 (11:39 +0200)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Thu, 18 Jun 2020 17:54:25 +0000 (10:54 -0700)
commitcd5b025ef85075f502fd52813dcc56ce9c8ce3cf
tree7a964ade9225c413148feb5160bf7354860742f9
parent55127d67786fb1ad4a54653eee183b85afa1f4c2
ICU-20545 Detect file separator char from dir

If udata_create won't find U_FILE_SEP_CHAR at the end of a dir variable,
then it appends it. The problem starts if the dir variable uses
U_FILE_ALT_SEP_CHAR which is not equal to U_FILE_SEP_CHAR. Then the
resulting path could look like this
../data\mappings/cns-11643-1992.ucm
instead of this
../data/mappings/cns-11643-1992.ucm

This patch uses U_FILE_SEP_CHAR unless it detects that the dir variable
doesn't use it, and uses U_FILE_ALT_SEP_CHAR instead.
icu4c/source/tools/toolutil/unewdata.cpp