diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-12-10 20:47:46 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-12-10 20:47:46 +0000 |
commit | 8720e933f44323fd886261f69ae767b41b388c17 (patch) | |
tree | 8000d30a3cedfb1e4abd2ac016d1e36647fc25f3 /lib | |
parent | af562032901445a7328b319ea7e4ae787c05d862 (diff) | |
download | libfuse-8720e933f44323fd886261f69ae767b41b388c17.tar.gz |
fix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse_opt.c | 6 | ||||
-rw-r--r-- | lib/helper.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c index 7767563..535cd38 100644 --- a/lib/fuse_opt.c +++ b/lib/fuse_opt.c @@ -28,9 +28,8 @@ struct fuse_opt_context { void fuse_opt_free_args(char *args[]) { - int i; - if (args) { + int i; for (i = 0; args[i]; i++) free(args[i]); free(args); @@ -319,6 +318,9 @@ static int opt_parse(struct fuse_opt_context *ctx) insert_arg(ctx, 2, ctx->opts) == -1) return -1; } + if (strcmp(ctx->argv[ctx->argc - 1], "--") == 0) + ctx->argv[--ctx->argc] = NULL; + return 0; } diff --git a/lib/helper.c b/lib/helper.c index 1f99c2f..bb02a3a 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -226,7 +226,10 @@ static int fuse_parse_cmdline(int argc, const char *argv[], return -1; } sprintf(fsname_opt, "fsname=%s", basename); - fuse_opt_add_opt(&hopts->kernel_opts, fsname_opt); + res = fuse_opt_add_opt(&hopts->kernel_opts, fsname_opt); + free(fsname_opt); + if (res == -1) + return -1; } return 0; } |