From: Jeremy Allison Date: Thu, 15 Dec 2022 21:24:12 +0000 (-0800) Subject: s3: smbd: Make extract_snapshot_token() a wrapper for extract_snapshot_token_internal(). X-Git-Tag: talloc-2.4.0~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdc6449a3fdfb342184d6a30f22d8cf9cf708841;p=thirdparty%2Fsamba.git s3: smbd: Make extract_snapshot_token() a wrapper for extract_snapshot_token_internal(). Allows us to pass in path separator from a new function without changing existing calling code. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c index 5a94b391dd6..319f500368b 100644 --- a/source3/lib/util_path.c +++ b/source3/lib/util_path.c @@ -287,14 +287,14 @@ bool clistr_is_previous_version_path(const char *path, return true; } -bool extract_snapshot_token(char *fname, NTTIME *twrp) +static bool extract_snapshot_token_internal(char *fname, NTTIME *twrp, char sep) { const char *start = NULL; const char *next = NULL; size_t remaining; bool found; - found = find_snapshot_token(fname, '/', &start, &next, twrp); + found = find_snapshot_token(fname, sep, &start, &next, twrp); if (!found) { return false; } @@ -305,6 +305,11 @@ bool extract_snapshot_token(char *fname, NTTIME *twrp) return true; } +bool extract_snapshot_token(char *fname, NTTIME *twrp) +{ + return extract_snapshot_token_internal(fname, twrp, '/'); +} + /* * Take two absolute paths, figure out if "subdir" is a proper * subdirectory of "parent". Return the component relative to the