use larger string heap
[rrq/fuse_xattrs.git] / fuse_xattrs.c
index 3539c652bce620b7ca52059051bd956f8872e58d..a19b1e595ace8198b415b34e06fdf65705a020e5 100644 (file)
@@ -206,8 +206,8 @@ const char *sanitized_source_directory(const char *path) {
        return NULL; // Path badness
     }
 
-    // Append "/" and allocate new memory for the string
-    return strdup( strcat( absolute_path, "/" ) );
+    // Allocate new memory for the string
+    return strdup( absolute_path );
 }
 
 enum {
@@ -244,16 +244,17 @@ static int xattrs_opt_proc(void *data, const char *arg, int key,
         case KEY_HELP:
             fprintf(stderr,
                     "usage: %s source_dir mountpoint [options]\n"
-                            "\n"
-                            "general options:\n"
-                            "    -o opt,[opt...]  mount options\n"
-                            "    -h   --help      print help\n"
-                            "    -V   --version   print version\n"
-                            "\n"
-                            "FUSE XATTRS options:\n"
-                            "    -o show_sidecar  don't hide sidecar files\n"
-                            "    -o enable_namespaces  enable namespaces checks\n"
-                            "\n", outargs->argv[0]);
+                   "\n"
+                   "general options:\n"
+                   "    -o opt,[opt...]  mount options\n"
+                   "    -h   --help      print help\n"
+                   "    -V   --version   print version\n"
+                   "\n"
+                   "FUSE XATTRS options:\n"
+                   "    -o show_sidecar  don't hide sidecar files\n"
+                   "    -o enable_namespaces  enable namespaces checks\n"
+                   "    -o sroot=path  use other sidecar root path\n"
+                   "\n", outargs->argv[0]);
 
             fuse_opt_add_arg(outargs, "-ho");
             fuse_main(outargs->argc, outargs->argv, &xmp_oper, NULL);
@@ -279,6 +280,7 @@ int main(int argc, char *argv[]) {
     if ( xattrs_config.sidecar_dir ) {
        xattrs_config.sidecar_dir =
            sanitized_source_directory( xattrs_config.sidecar_dir );
+       xattrs_config.sidecar_dir_size = strlen( xattrs_config.sidecar_dir );
     }
     
     if (!xattrs_config.source_dir) {