Handle empty string in search path; It means: current directory
This commit is contained in:
parent
59ea3478ac
commit
9baa112ea1
|
@ -233,8 +233,10 @@ INP_mk_filename(dir, file, newname)
|
||||||
dst = malloc((unsigned) (strlen(dir) + strlen(file) + 2));
|
dst = malloc((unsigned) (strlen(dir) + strlen(file) + 2));
|
||||||
if (!dst) return 0;
|
if (!dst) return 0;
|
||||||
*newname = dst;
|
*newname = dst;
|
||||||
while (*dst++ = *dir++);
|
if (*dir) {
|
||||||
*--dst = '/';
|
while (*dst++ = *dir++);
|
||||||
|
*--dst = '/';
|
||||||
|
}
|
||||||
while (*++dst = *file++);
|
while (*++dst = *file++);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue