Skip -bak, not .bak. And a cosmetic fix.

This commit is contained in:
Eric S. Raymond 2007-11-08 17:40:57 +00:00
parent 1920174d39
commit 9c16e2bd08
2 changed files with 2 additions and 2 deletions

View file

@ -314,7 +314,7 @@ class CampaignClient:
for fn in glob.glob(path + "/*"):
if os.path.isdir(fn):
sub = put_dir(os.path.basename(fn), fn)
elif fn.endswith("~") or fn.endswith(".bak") or ".pbl" in fn:
elif fn.endswith("~") or fn.endswith("-bak") or ".pbl" in fn:
continue
else:
sub = put_file(os.path.basename(fn), file(fn))

View file

@ -181,7 +181,7 @@ static void archive_dir(const std::string& path, const std::string& dirname, con
std::vector<std::string> files, dirs;
get_files_in_dir(dir,&files,&dirs);
for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
if (ends_with(*i, "~")||ends_with(*i, "-bak")||(*i).find(".pbl")!=std::string::npos)
if (ends_with(*i, "~")||ends_with(*i, "-bak")||(*i).find(".pbl")!=std::string::npos)
continue;
archive_file(dir,*i,cfg.add_child("file"));
}