Code

Document the --histogram diff option
[git.git] / quote.c
diff --git a/quote.c b/quote.c
index 87bc65eed8bb2cc177fb39d73a193f0a037524c7..911229fdf3caffe29a87aea76f38dc50863797d4 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -342,8 +342,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;