X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=quote.c;h=532fd3b7b7a0c7b6766a7af742b0c7362f307221;hb=473f4c96e315478185c4a07d6e7fb65801ee40b9;hp=63d3b018183abc05a5231dfd7e134dd7394f7a9b;hpb=40ffc49876611150104102d59a35d865e4670bd7;p=git.git diff --git a/quote.c b/quote.c index 63d3b0181..532fd3b7b 100644 --- a/quote.c +++ b/quote.c @@ -325,8 +325,12 @@ static const char *path_relative(const char *in, int len, if (len < 0) len = strlen(in); - if (prefix && prefix_len < 0) - prefix_len = strlen(prefix); + if (prefix_len < 0) { + if (prefix) + prefix_len = strlen(prefix); + else + prefix_len = 0; + } off = 0; i = 0;