]> granicus.if.org Git - icu/commitdiff
ICU-8928 Fix how path is found when pkgdata needs icu-config
authorMichael Ow <mow@svn.icu-project.org>
Thu, 10 Nov 2011 23:11:19 +0000 (23:11 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Thu, 10 Nov 2011 23:11:19 +0000 (23:11 +0000)
X-SVN-Rev: 30949

icu4c/source/test/cintltst/putiltst.c
icu4c/source/tools/pkgdata/pkgdata.cpp
icu4c/source/tools/toolutil/toolutil.cpp
icu4c/source/tools/toolutil/toolutil.h

index d9da7fad9320c7ececd0fe6cc42ae71a9edd8674..d4a3a466608490f8dee5d4d72c3216b84d3d4dfc 100644 (file)
@@ -638,23 +638,11 @@ static void toolutil_findDirname(void)
       U_BUFFER_OVERFLOW_ERROR,
       NULL
     },
-    {
-      "pkgdata",
-      1,
-      U_BUFFER_OVERFLOW_ERROR,
-      NULL
-    },
     {
       "pkgdata",
       2,
       U_ZERO_ERROR,
-      "."
-    },
-    {
-      "pkgdata",
-      20,
-      U_ZERO_ERROR,
-      "."
+      ""
     }
   };
   int32_t count=(sizeof(testCases)/sizeof(testCases[0]));
index 5ca6082ab357f42154c73dc8cc838f52b5ed9b25..af9cf4ee961ff299f79a48c34bbdd0dc7cbb1f5f 100644 (file)
@@ -1873,7 +1873,9 @@ static void loadLists(UPKGOptions *o, UErrorCode *status)
     /* #1 try the same path where pkgdata was called from. */
     findDirname(progname, cmdBuf, 1024, &status);
     if(U_SUCCESS(status)) {
-      uprv_strncat(cmdBuf, U_FILE_SEP_STRING, 1024);
+      if (cmdBuf[0] != 0) {
+          uprv_strncat(cmdBuf, U_FILE_SEP_STRING, 1024);
+      }
       uprv_strncat(cmdBuf, cmd, 1024);
       
       if(verbose) {
index b42044ed7fe984ef591305ef0d7a3dd4b71c428b..7c02efc37b107c5658d7fb656a4c8bac0a9a5544 100644 (file)
@@ -125,9 +125,9 @@ findDirname(const char *path, char *buffer, int32_t bufLen, UErrorCode* status)
   }
 #endif
   if(!basename) {
-    /* no basename - return '.'. */
-    resultPtr = ".";
-    resultLen = 1;
+    /* no basename - return ''. */
+    resultPtr = "";
+    resultLen = 0;
   } else {
     resultPtr = path;
     resultLen = basename - path;
index 360b13833f9da8b42d44c7577e18513aeb82cf04..7b93211c2b9d9f0327e579104e8e576e890b952f 100644 (file)
@@ -84,7 +84,7 @@ findBasename(const char *filename);
  * If successful, copies the directory name into the output buffer along with
  * a terminating NULL. 
  *
- * If there isn't a directory name in the path, it returns the current directory string ('.').
+ * If there isn't a directory name in the path, it returns an empty string.
  * @param path the full pathname to inspect. 
  * @param buffer the output buffer
  * @param bufLen the output buffer length