ICU-426 udata_create changed so that if output dir is NULL, creates output file in current directory. Before, it used to open output file in $ICU_DATA dir.

X-SVN-Rev: 1573
This commit is contained in:
Vladimir Weinstein 2000-06-06 19:26:16 +00:00
parent 5399dc4eea
commit 7a7ab66a6b

View File

@ -53,17 +53,14 @@ udata_create(const char *dir, const char *type, const char *name,
}
/* open the output file */
if(dir==NULL) {
dir=u_getDataDirectory();
}
if(dir!=NULL && *dir!=0) {
if(dir!=NULL && *dir!=0) { /* if dir has a value, we prepend it to the filename */
char *p=filename+strlen(dir);
uprv_strcpy(filename, dir);
if (*(p-1)!=U_FILE_SEP_CHAR) {
*p++=U_FILE_SEP_CHAR;
*p=0;
}
} else {
} else { /* otherwise, we'll output to the current dir */
filename[0]=0;
}
uprv_strcat(filename, name);