py/tripe.py.in: Raise an error if a command token contains a newline.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 13 Jun 2020 15:49:47 +0000 (16:49 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 13 Jun 2020 15:50:46 +0000 (16:50 +0100)
This should never happen, and it confuses the client quite badly if it
does.

py/tripe.py.in

index a9be668..db194e2 100644 (file)
@@ -446,6 +446,9 @@ class TripeCommand (object):
 
   def __init__(me, words):
     """Make a new command consisting of the given list of WORDS."""
+    for word in words:
+      if '\n' in word:
+        raise TripeInternalError("command word contains newline")
     me.words = words
 
 class TripeSynchronousCommand (TripeCommand):