Make sure the first element in the args list is an empty string always;
authorDerrik Pates <demon@now.ai>
Thu, 19 May 2011 18:02:40 +0000 (12:02 -0600)
committerDerrik Pates <demon@now.ai>
Thu, 19 May 2011 18:02:40 +0000 (12:02 -0600)
didn't think about the fact that if no "mountopts" is given, but "debug"
is true, there won't be one.

Fuse.xs

diff --git a/Fuse.xs b/Fuse.xs
index 8f448a8..8f7be78 100755 (executable)
--- a/Fuse.xs
+++ b/Fuse.xs
@@ -1653,8 +1653,11 @@ perl_fuse_main(...)
         * to hack on compatibility with other parts of the new API. First and
         * foremost, real C argc/argv would be good to get at...
         */
         * to hack on compatibility with other parts of the new API. First and
         * foremost, real C argc/argv would be good to get at...
         */
+       if ((mountopts || debug) && fuse_opt_add_arg(&args, "") == -1) {
+               fuse_opt_free_args(&args);
+               croak("out of memory\n");
+       }
        if (mountopts &&
        if (mountopts &&
-           (fuse_opt_add_arg(&args, "") == -1 ||
             fuse_opt_add_arg(&args, "-o") == -1 ||
             fuse_opt_add_arg(&args, mountopts) == -1)) {
                fuse_opt_free_args(&args);
             fuse_opt_add_arg(&args, "-o") == -1 ||
             fuse_opt_add_arg(&args, mountopts) == -1)) {
                fuse_opt_free_args(&args);