]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
control: Strip trailing whitespace from commands
authorIan Campbell <ian.campbell@citrix.com>
Tue, 5 Nov 2013 16:27:39 +0000 (16:27 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 5 Nov 2013 16:27:39 +0000 (16:27 +0000)
Otherwise we try and interpret e.g. "! " as a message-id. (See
http://bugs.xenproject.org/xen/bug/17)

config/examples/test/control.18.test [new file with mode: 0644]
scripts/control.pl

diff --git a/config/examples/test/control.18.test b/config/examples/test/control.18.test
new file mode 100644 (file)
index 0000000..19c41a4
--- /dev/null
@@ -0,0 +1,7 @@
+From: Ian Campbell <ijc@hellion.org.uk>
+Subject: Command with trailing whitespace
+To: test-control@bugs.xenproject.org
+Message-Id: <control.test.18@fake.hellion.org.uk>
+
+create !     
+thanks
index 9c5e3ff99732e134f8be9bc484f34980fb4ebe6c..4534eacb4fa178fbadb63eb055db97886fa1ba30 100755 (executable)
@@ -428,7 +428,7 @@ while (<M>) {
     chomp();
     push @reply, "> $_";
 
-    s/#.*//g;
+    s/#.*//g; s/\s+$//;
     next if (m/^$/);
 
     my $done = 0;