summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-07-24 20:04:16 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-07-24 20:04:16 +0000
commit816897d4a2a92e815b4df9a9427b9649a83f841b (patch)
treeb3fbf9662d0b0c9ef3d56216edfb180e2cddf2d1 /source3/client
parent0cc966076afa4ce73e77cb5b3da9086542e47393 (diff)
downloadsamba-816897d4a2a92e815b4df9a9427b9649a83f841b.tar.gz
samba-816897d4a2a92e815b4df9a9427b9649a83f841b.tar.bz2
samba-816897d4a2a92e815b4df9a9427b9649a83f841b.zip
patch by glenn burkhardt to allow recursive excluding of directories.
glenn@aoi.ultranet.com lkcl (This used to be commit 4aac8449ae1f4e9d214071e8b254ce8b391496a4)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clitar.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 5afff63de4..951947ecb2 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -372,10 +372,15 @@ static long unoct(char *p, int ndgs)
}
/****************************************************************************
-Compare two strings in a slash insensitive way
+Compare two strings in a slash insensitive way, allowing s1 to match s2
+if s1 is an "initial" string (up to directory marker). Thus, if s2 is
+a file in any subdirectory of s1, declare a match.
***************************************************************************/
-int strslashcmp(char *s1,char *s2)
+static
+int strslashcmp(char *s1, char *s2)
{
+ char *s1_0=s1;
+
while(*s1 && *s2 &&
(*s1 == *s2
|| tolower(*s1) == tolower(*s2)
@@ -384,6 +389,17 @@ int strslashcmp(char *s1,char *s2)
s1++; s2++;
}
+ /* if s1 has a trailing slash, it compared equal, so s1 is an "initial"
+ string of s2.
+ */
+ if (!*s1 && s1 != s1_0 && (*(s1-1) == '/' || *(s1-1) == '\\')) return 0;
+
+ /* ignore trailing slash on s1 */
+ if (!*s2 && (*s1 == '/' || *s1 == '\\') && !*(s1+1)) return 0;
+
+ /* check for s1 is an "initial" string of s2 */
+ if (*s2 == '/' || *s2 == '\\') return 0;
+
return *s1-*s2;
}
@@ -1128,11 +1144,6 @@ static void do_tar(file_info *finfo)
strcpy(exclaim, cur_dir);
*(exclaim+strlen(exclaim)-1)='\0';
- if (clipfind(cliplist, clipn, exclaim)) {
- DEBUG(3,("Skipping directory %s\n", exclaim));
- return;
- }
-
strcat(exclaim, "\\");
strcat(exclaim, finfo->name);