aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/block.c b/block.c
index 50ba264143..b72b872806 100644
--- a/block.c
+++ b/block.c
@@ -163,11 +163,16 @@ void path_combine(char *dest, int dest_size,
if (path_is_absolute(filename)) {
pstrcpy(dest, dest_size, filename);
} else {
- p = strchr(base_path, ':');
- if (p)
- p++;
- else
- p = base_path;
+ const char *protocol_stripped = NULL;
+
+ if (path_has_protocol(base_path)) {
+ protocol_stripped = strchr(base_path, ':');
+ if (protocol_stripped) {
+ protocol_stripped++;
+ }
+ }
+ p = protocol_stripped ?: base_path;
+
p1 = strrchr(base_path, '/');
#ifdef _WIN32
{