X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=fuse_xattrs.c;h=a19b1e595ace8198b415b34e06fdf65705a020e5;hb=bced32cd120e3f3e12a11a4a2fa680a83d6e9b29;hp=3539c652bce620b7ca52059051bd956f8872e58d;hpb=a93f22e050e3bc971f341ab4580d39266713133b;p=rrq%2Ffuse_xattrs.git diff --git a/fuse_xattrs.c b/fuse_xattrs.c index 3539c65..a19b1e5 100644 --- a/fuse_xattrs.c +++ b/fuse_xattrs.c @@ -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) {