From: Ralph Ronnquist Date: Sat, 13 Nov 2021 00:17:44 +0000 (+1100) Subject: cache the size of the sidecar_dir path X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=bced32cd120e3f3e12a11a4a2fa680a83d6e9b29;p=rrq%2Ffuse_xattrs.git cache the size of the sidecar_dir path --- diff --git a/fuse_xattrs.c b/fuse_xattrs.c index 335f1c2..a19b1e5 100644 --- a/fuse_xattrs.c +++ b/fuse_xattrs.c @@ -280,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) { diff --git a/xattrs_config.h b/xattrs_config.h index 6d8be2a..8c01dd3 100644 --- a/xattrs_config.h +++ b/xattrs_config.h @@ -14,6 +14,7 @@ extern struct xattrs_config { const int show_sidecar; const int enable_namespaces; const char *sidecar_dir; + size_t sidecar_dir_size; const char *source_dir; size_t source_dir_size; } xattrs_config;