summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-05-16 00:07:06 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-16 00:07:07 +0000
commitb733b3c7b0601326801d43f548aa139ca0be721e (patch)
tree00d37b4a500fca13260636ebd883a9d5c88f2847
parentcb8ac609ee27a9e5e6e13bc30447ed3a13964ccd (diff)
parent7b4448de8deaef2512fb0b17a30facc47b2f4a87 (diff)
downloadextras-b733b3c7b0601326801d43f548aa139ca0be721e.tar.gz
Merge "The situation len = 0 and absolute = false need to be handled"
-rw-r--r--ext4_utils/make_ext4fs.c7
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) {