aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-12-10 20:47:46 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-12-10 20:47:46 +0000
commit8720e933f44323fd886261f69ae767b41b388c17 (patch)
tree8000d30a3cedfb1e4abd2ac016d1e36647fc25f3
parentaf562032901445a7328b319ea7e4ae787c05d862 (diff)
downloadlibfuse-8720e933f44323fd886261f69ae767b41b388c17.tar.gz
fix
-rw-r--r--lib/fuse_opt.c6
-rw-r--r--lib/helper.c5
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;
}