diff options
author | Colin Cross <ccross@android.com> | 2014-05-16 00:07:06 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-16 00:07:07 +0000 |
commit | b733b3c7b0601326801d43f548aa139ca0be721e (patch) | |
tree | 00d37b4a500fca13260636ebd883a9d5c88f2847 | |
parent | cb8ac609ee27a9e5e6e13bc30447ed3a13964ccd (diff) | |
parent | 7b4448de8deaef2512fb0b17a30facc47b2f4a87 (diff) | |
download | extras-b733b3c7b0601326801d43f548aa139ca0be721e.tar.gz |
Merge "The situation len = 0 and absolute = false need to be handled"
-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) { |