From 86d25933d21e99f18340e21bc24f2029136f7504 Mon Sep 17 00:00:00 2001 From: pache Date: Mon, 19 Jan 2015 14:05:54 +0000 Subject: [PATCH 1/2] Fix bug where executing a single command (with no arguments) would trigger shell expansion. --- shirt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shirt b/shirt index b1b28f2..73c31f8 100755 --- a/shirt +++ b/shirt @@ -60,7 +60,12 @@ def spawn_program(program, *arguments, placeholder_out, placeholder_in) placeholder_in.close end - exec program, *arguments + case arguments.empty? + when true + exec [program, ""] + else + exec program, *arguments + end } end From 3eed1daf0fa39cde32bc331f4c4161a771d37c23 Mon Sep 17 00:00:00 2001 From: patchouli Date: Mon, 19 Jan 2015 14:20:05 +0000 Subject: [PATCH 2/2] Refactored case to if. pff what was I thinking? --- shirt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/shirt b/shirt index 73c31f8..6395ecc 100755 --- a/shirt +++ b/shirt @@ -60,11 +60,10 @@ def spawn_program(program, *arguments, placeholder_out, placeholder_in) placeholder_in.close end - case arguments.empty? - when true - exec [program, ""] - else - exec program, *arguments + if arguments.empty? + exec [program, ""] + else + exec program, *arguments end } end