Handle empty string in search path; It means: current directory

This commit is contained in:
ceriel 1989-02-16 10:48:06 +00:00
parent 59ea3478ac
commit 9baa112ea1

View file

@ -233,8 +233,10 @@ INP_mk_filename(dir, file, newname)
dst = malloc((unsigned) (strlen(dir) + strlen(file) + 2));
if (!dst) return 0;
*newname = dst;
if (*dir) {
while (*dst++ = *dir++);
*--dst = '/';
}
while (*++dst = *file++);
return 1;
}