don't add files with / \ or : to log

This commit is contained in:
Damien Elmes 2012-06-02 17:05:00 +09:00
parent a7815856e6
commit f88bc6ff60

View file

@ -400,6 +400,14 @@ create table log (fname text primary key, type int);
continue
if f.lower() == "thumbs.db":
continue
# and files with invalid chars
bad = False
for c in "\0", "/", "\\", ":":
if c in f:
bad = True
break
if bad:
continue
# empty files are invalid; clean them up and continue
if not os.path.getsize(f):
os.unlink(f)