summaryrefslogtreecommitdiff
path: root/block/nbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/nbd.c')
-rw-r--r--block/nbd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 6d3b22f844..f69e61e68a 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1528,8 +1528,10 @@ static int nbd_parse_uri(const char *filename, QDict *options)
goto out;
}
- p = uri->path ? uri->path : "/";
- p += strspn(p, "/");
+ p = uri->path ? uri->path : "";
+ if (p[0] == '/') {
+ p++;
+ }
if (p[0]) {
qdict_put_str(options, "export", p);
}