From fd4ffa53dff9c9a71bc322d2105cbc0559d597ad Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 27 Jan 2012 16:42:13 +0100 Subject: Interpret octal escape codes in options Requested by Jan Engelhardt --- lib/fuse_opt.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/fuse_opt.c') 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++; } -- cgit v1.2.3