s3: smbd: Make extract_snapshot_token() a wrapper for extract_snapshot_token_internal().
authorJeremy Allison <jra@samba.org>
Thu, 15 Dec 2022 21:24:12 +0000 (13:24 -0800)
committerVolker Lendecke <vl@samba.org>
Fri, 16 Dec 2022 07:42:38 +0000 (07:42 +0000)
Allows us to pass in path separator from a new function without
changing existing calling code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/lib/util_path.c

index 5a94b391dd642e4c1e57f4e1fb1eb7d7a3acc6fa..319f500368b62ed503fd81afaa1f803338907982 100644 (file)
@@ -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