X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup.c;h=346ef2eb2d678b742280c0816a09b8ca174ca799;hb=c14daa4845ff2ec0d27807fa50f9fac1ca4d6462;hp=a3b76de2bb1c18e2f3b8cdf5799c3c650b16d027;hpb=d42cb5804f9c52b88b6dfe709a659e31394ea2ae;p=git.git diff --git a/setup.c b/setup.c index a3b76de2b..346ef2eb2 100644 --- a/setup.c +++ b/setup.c @@ -46,7 +46,7 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg) { static char path[PATH_MAX]; #ifndef WIN32 - if (!pfx || !*pfx || is_absolute_path(arg)) + if (!pfx_len || is_absolute_path(arg)) return arg; memcpy(path, pfx, pfx_len); strcpy(path + pfx_len, arg); @@ -55,7 +55,7 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg) /* don't add prefix to absolute paths, but still replace '\' by '/' */ if (is_absolute_path(arg)) pfx_len = 0; - else + else if (pfx_len) memcpy(path, pfx, pfx_len); strcpy(path + pfx_len, arg); for (p = path + pfx_len; *p; p++)