Explicitly reject target/source filenames with newlines in them.

This avoids an ugly assertion failure when we try to log a message
containing an inner newline.
This commit is contained in:
Avery Pennarun 2019-03-02 03:09:42 -05:00
commit 83bc49512f

View file

@ -478,6 +478,11 @@ def run(targets, shouldbuildfunc):
else: else:
selflock = myfile = me = None selflock = myfile = me = None
for t in targets:
if '\n' in t:
err('%r: filenames containing newlines are not allowed.\n' % t)
return 204
def cheat(): def cheat():
if not selflock: if not selflock:
return 0 return 0