aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse_opt.c
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <mszeredi@suse.cz>2012-01-27 16:42:13 +0100
committerGravatar Miklos Szeredi <mszeredi@suse.cz>2012-01-27 16:42:33 +0100
commitfd4ffa53dff9c9a71bc322d2105cbc0559d597ad (patch)
tree111a129394fb8e74f1a31bccf0363a31a2ad59dc /lib/fuse_opt.c
parentb02843393f53482f9efa7ada2dca0996356833c3 (diff)
Interpret octal escape codes in options
Requested by Jan Engelhardt
Diffstat (limited to 'lib/fuse_opt.c')
-rw-r--r--lib/fuse_opt.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c
index b912764..a2118ce 100644
--- a/lib/fuse_opt.c
+++ b/lib/fuse_opt.c
@@ -309,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++;
}