Always include "." when processing exclude lists. This avoids confusion
authorDavid Dykstra <dwd@samba.org>
Tue, 24 Nov 1998 21:26:38 +0000 (21:26 +0000)
committerDavid Dykstra <dwd@samba.org>
Tue, 24 Nov 1998 21:26:38 +0000 (21:26 +0000)
when people do --exclude "*".  Also, add an example to the man page that
shows explicitly including parent directories when itemizing specific
paths to include followed by --exclude "*".

exclude.c
rsync.yo
rsyncd.conf.yo

index 109ee8d61ce5a2eac7d09620c449417bf56d8e36..35fa307a93ad3b9009aef20174213768cb5be599 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -160,6 +160,10 @@ int check_exclude(char *name,struct exclude_struct **local_exclude_list,
 {
        int n;
 
+       if (name && (name[0] == '.') && !name[1])
+               /* never exclude '.', even if somebody does --exclude '*' */
+               return 0;
+
        if (exclude_list) {
                for (n=0; exclude_list[n]; n++)
                        if (check_one_exclude(name,exclude_list[n],st))
index ec8ada114e372b068698917994db1c732987cd55..0885dd6c8ec6fbd689bace4851583c826da7a454 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -1,5 +1,5 @@
 mailto(rsync-bugs@samba.org)
-manpage(rsync)(1)(11 Nov 1998)()()
+manpage(rsync)(1)(24 Nov 1998)()()
 manpagename(rsync)(faster, flexible replacement for rcp)
 manpagesynopsis()
 
@@ -637,7 +637,10 @@ itemize(
   it() --exclude "/foo" would exclude a file in the base directory called foo
   it() --exclude "foo/" would exclude any directory called foo
   it() --include "*/" --include "*.c" --exclude "*" would include all 
-  directories and C source files.
+  directories and C source files
+  it() --include "foo/" --include "foo/bar.c" --exclude "*" would include
+  only foo/bar.c (the foo/ directory must be explicitly included or
+  it would be excluded by the "*")
 )
 
 manpagesection(DIAGNOSTICS)
index 6aae9290f81095c9139e9ead45261fb6e20d12e5..2571f2966f32b89c6ce43d57eaccaeee1cd6d402 100644 (file)
@@ -1,5 +1,5 @@
 mailto(rsync-bugs@samba.org)
-manpage(rsyncd.conf)(5)(18 Nov 1998)()()
+manpage(rsyncd.conf)(5)(24 Nov 1998)()()
 manpagename(rsyncd.conf)(configuration file for rsync server)
 manpagesynopsis()