mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-21 15:36:33 -05:00
Add Btrfs snapshot support for atomic sync and recovery consistency
This commit is contained in:
parent
d2c1029017
commit
cffd1ca15c
18 changed files with 1094 additions and 39 deletions
|
|
@ -1165,6 +1165,25 @@ void pathcut(char* dst)
|
|||
dst[0] = 0;
|
||||
}
|
||||
|
||||
void pathup(char* dst)
|
||||
{
|
||||
size_t len = strlen(dst);
|
||||
|
||||
if (len == 0)
|
||||
return;
|
||||
|
||||
/* if ending with slash, remove it */
|
||||
if (dst[len - 1] == '/')
|
||||
--len;
|
||||
|
||||
/* search previous / */
|
||||
while (len > 0 && dst[len - 1] != '/')
|
||||
--len;
|
||||
|
||||
/* cut everything after the slash (if there are no more slash, return the empty string) */
|
||||
dst[len] = 0;
|
||||
}
|
||||
|
||||
int pathcmp(const char* a, const char* b)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue