From: ceriel Date: Thu, 16 Feb 1989 10:48:06 +0000 (+0000) Subject: Handle empty string in search path; It means: current directory X-Git-Tag: release-5-5~2576 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9baa112ea17a8ced7fe4e27f6a3de8c1a67ec025;p=ack.git Handle empty string in search path; It means: current directory --- 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; }