-Prune breaks if -Root ends on two slashes

mannino <[email protected]> Wed, 12 Feb 2025 15:15:44 +0300
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
Whenever -R is given that ends on EXACTLY two slashes AND does not 
contain two or more slashes anywhere else then -P options are ignored 
and it's impossible to prune a subtree from archiving.

This problem is present as early as dar 2.5.

   dar version 2.7.16
   Using libdar 6.8.0
   compiled the Feb 12 2025 with GNUC version 9.4.0
   dar is part of the Disk ARchive suite (Release 2.7.16)

# find /tmp/test
/tmp/test
/tmp/test/1
/tmp/test/1/a
/tmp/test/1/b
/tmp/test/2
/tmp/test/2/c
/tmp/test/2/d

# dar -c /tmp/s -R /tmp/test/ -P 1 -vs
Skipping file: /tmp/test/1
[...]
3 inode(s) saved
1 inode(s) ignored (excluded by filters)

# dar -c /tmp/s -R /tmp/test// -P 1 -vs
<no Skipping file>
[...]
6 inode(s) saved
0 inode(s) ignored (excluded by filters)

# dar -c /tmp/s -R /tmp/test/// -P 1 -vs
Skipping file: /tmp/test/1

# dar -c /tmp/s -R /tmp//test// -P 1 -vs
Skipping file: /tmp/test/1