summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/quote.c b/quote.c
index 63d3b01..532fd3b 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;