py/makeqstrdefs.py: Fix beaviour when scanning non-C preprocessed files.

When process_file() is passed a preprocessed C++ file for instance it won't
find any lines containing .c files and the last_fname variable remains
None, so handle that gracefully.
bound-method-equality
stijn 2020-08-26 11:23:10 +02:00 committed by Damien George
parent 6f34800884
commit 1b723937e3
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ def process_file(f):
elif args.mode == _MODE_COMPRESS:
output.append(match)
write_out(last_fname, output)
if last_fname:
write_out(last_fname, output)
return ""