summaryrefslogtreecommitdiffstats
path: root/fuse/fuse_opt.c
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-02-06 20:13:00 +0100
committerbigbiff bigbiff <bigbiff@teamw.in>2013-02-07 14:21:17 +0100
commite34c133ec6053025124416a3861f9f4c4f7fd772 (patch)
tree027d856cea0aa7abd29234727ef0924683d4d409 /fuse/fuse_opt.c
parentMerge "Fix misspelling and white space on fix perms" into twrp2.4 (diff)
downloadandroid_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar.gz
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar.bz2
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar.lz
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar.xz
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.tar.zst
android_bootable_recovery-e34c133ec6053025124416a3861f9f4c4f7fd772.zip
Diffstat (limited to 'fuse/fuse_opt.c')
-rw-r--r--fuse/fuse_opt.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/fuse/fuse_opt.c b/fuse/fuse_opt.c
index b15e7db11..a2118cedc 100644
--- a/fuse/fuse_opt.c
+++ b/fuse/fuse_opt.c
@@ -54,10 +54,15 @@ int fuse_opt_add_arg(struct fuse_args *args, const char *arg)
assert(!args->argv || args->allocated);
+ newarg = strdup(arg);
+ if (!newarg)
+ return alloc_failed();
+
newargv = realloc(args->argv, (args->argc + 2) * sizeof(char *));
- newarg = newargv ? strdup(arg) : NULL;
- if (!newargv || !newarg)
+ if (!newargv) {
+ free(newarg);
return alloc_failed();
+ }
args->argv = newargv;
args->allocated = 1;
@@ -304,9 +309,21 @@ static int process_real_option_group(struct fuse_opt_context *ctx, char *opts)
return -1;
d = opts;
} else {
- if (s[0] == '\\' && s[1] != '\0')
+ if (s[0] == '\\' && s[1] != '\0') {
s++;
- *d++ = *s;
+ if (s[0] >= '0' && s[0] <= '3' &&
+ s[1] >= '0' && s[1] <= '7' &&
+ s[2] >= '0' && s[2] <= '7') {
+ *d++ = (s[0] - '0') * 0100 +
+ (s[1] - '0') * 0010 +
+ (s[2] - '0');
+ s += 2;
+ } else {
+ *d++ = *s;
+ }
+ } else {
+ *d++ = *s;
+ }
}
s++;
}