From 9baa112ea17a8ced7fe4e27f6a3de8c1a67ec025 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 16 Feb 1989 10:48:06 +0000 Subject: [PATCH] Handle empty string in search path; It means: current directory --- modules/src/input/inp_pkg.body | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/src/input/inp_pkg.body b/modules/src/input/inp_pkg.body index bf650d622..39d69e066 100644 --- a/modules/src/input/inp_pkg.body +++ b/modules/src/input/inp_pkg.body @@ -233,8 +233,10 @@ INP_mk_filename(dir, file, newname) dst = malloc((unsigned) (strlen(dir) + strlen(file) + 2)); if (!dst) return 0; *newname = dst; - while (*dst++ = *dir++); - *--dst = '/'; + if (*dir) { + while (*dst++ = *dir++); + *--dst = '/'; + } while (*++dst = *file++); return 1; } -- 2.34.1