]> granicus.if.org Git - icu/commitdiff
ICU-20345 Skip ahead some files in searchForTZFile
authorSemun Lee <semun.lee@samsung.com>
Mon, 14 Jan 2019 01:36:50 +0000 (10:36 +0900)
committerYoshito Umaoka <yumaoka@users.noreply.github.com>
Thu, 21 Feb 2019 02:09:46 +0000 (21:09 -0500)
Change-Id: I61042ca66f86457768e8fc0315137051013d2820
Signed-off-by: Semun Lee <semun.lee@samsung.com>
icu4c/source/common/putil.cpp

index a41a4c1094ddd10d0e9e8576c645aeb3df3c47a1..cdfaed9936bd3b7a091182dc623e0c391e216086 100644 (file)
@@ -986,7 +986,8 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
     /* Check each entry in the directory. */
     while((dirEntry = readdir(dirp)) != NULL) {
         const char* dirName = dirEntry->d_name;
-        if (uprv_strcmp(dirName, SKIP1) != 0 && uprv_strcmp(dirName, SKIP2) != 0) {
+        if (uprv_strcmp(dirName, SKIP1) != 0 && uprv_strcmp(dirName, SKIP2) != 0
+            && uprv_strcmp(TZFILE_SKIP, dirName) != 0 && uprv_strcmp(TZFILE_SKIP2, dirName) != 0) {
             /* Create a newpath with the new entry to test each entry in the directory. */
             CharString newpath(curpath, status);
             newpath.append(dirName, -1, status);
@@ -1013,7 +1014,7 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
                 */
                 if (result != NULL)
                     break;
-            } else if (uprv_strcmp(TZFILE_SKIP, dirName) != 0 && uprv_strcmp(TZFILE_SKIP2, dirName) != 0) {
+            } else {
                 if(compareBinaryFiles(TZDEFAULT, newpath.data(), tzInfo)) {
                     int32_t amountToSkip = sizeof(TZZONEINFO) - 1;
                     if (amountToSkip > newpath.length()) {