mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-8928 Fix how path is found when pkgdata needs icu-config
X-SVN-Rev: 30949
This commit is contained in:
parent
895e909e90
commit
ab32395a4f
4 changed files with 8 additions and 18 deletions
|
@ -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]));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue