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; }