X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/32f761755e2cfee243a1513c9ea9871586463fa6..b45b059a3dcfcf835a8925c23240a3a49311ca44:/exclude.c diff --git a/exclude.c b/exclude.c index dc469e18..e1b25886 100644 --- a/exclude.c +++ b/exclude.c @@ -220,8 +220,14 @@ struct exclude_struct **make_exclude_list(const char *fname, int fatal, int include) { struct exclude_struct **list=list1; - FILE *f = fopen(fname,"r"); + FILE *f; char line[MAXPATHLEN]; + + if (strcmp(fname, "-")) { + f = fopen(fname,"r"); + } else { + f = fdopen(0, "r"); + } if (!f) { if (fatal) { rsyserr(FERROR, errno, @@ -235,7 +241,7 @@ struct exclude_struct **make_exclude_list(const char *fname, while (fgets(line,MAXPATHLEN,f)) { int l = strlen(line); - if (l && line[l-1] == '\n') l--; + while (l && (line[l-1] == '\n' || line[l-1] == '\r')) l--; line[l] = 0; if (line[0] && (line[0] != ';') && (line[0] != '#')) { /* Skip lines starting with semicolon or pound. @@ -387,12 +393,11 @@ void add_include_line(char *p) static char *cvs_ignore_list[] = { - "RCS","SCCS","CVS","CVS.adm","RCSLOG","cvslog.*", - "tags","TAGS",".make.state",".nse_depinfo", - "*~", "#*", ".#*", ",*", "*.old", "*.bak", "*.BAK", "*.orig", + "RCS/", "SCCS/", "CVS/", ".svn/", "CVS.adm", "RCSLOG", "cvslog.*", + "tags", "TAGS", ".make.state", ".nse_depinfo", + "*~", "#*", ".#*", ", *", "*.old", "*.bak", "*.BAK", "*.orig", "*.rej", ".del-*", "*.a", "*.o", "*.obj", "*.so", "*.Z", "*.elc", "*.ln", - "core",NULL}; - + "core", NULL}; void add_cvs_excludes(void)