diff options
-rw-r--r-- | ext4_utils/make_ext4fs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c index b9a24b83..f164883e 100644 --- a/ext4_utils/make_ext4fs.c +++ b/ext4_utils/make_ext4fs.c @@ -427,8 +427,11 @@ static char *canonicalize_slashes(const char *str, bool absolute) int newlen = len; char *ptr; - if (len == 0 && absolute) { - return strdup("/"); + if (len == 0) { + if (absolute) + return strdup("/"); + else + return strdup(""); } if (str[0] != '/' && absolute) { |