Fix support for DOS newlines in list files
This commit is contained in:
parent
3b6f7a58b3
commit
53049d4781
|
@ -144,7 +144,7 @@ class MassDnsParser(Parser):
|
||||||
timestamp = 0
|
timestamp = 0
|
||||||
header = True
|
header = True
|
||||||
for line in self.buf:
|
for line in self.buf:
|
||||||
line = line[:-1]
|
line = line.rstrip()
|
||||||
if not line:
|
if not line:
|
||||||
header = True
|
header = True
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -29,7 +29,7 @@ if __name__ == '__main__':
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
for line in args.input:
|
for line in args.input:
|
||||||
line = line[:-1].lower()
|
line = line.rstrip().lower()
|
||||||
if (args.domain and database.Database.validate_domain(line)) or \
|
if (args.domain and database.Database.validate_domain(line)) or \
|
||||||
(args.ip4 and database.Database.validate_ip4address(line)):
|
(args.ip4 and database.Database.validate_ip4address(line)):
|
||||||
print(line, file=args.output)
|
print(line, file=args.output)
|
||||||
|
|
Loading…
Reference in a new issue