Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix the stack-cleaner
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 6 Nov 2014 13:14:31 +0000 (14:14 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 6 Nov 2014 13:14:31 +0000 (14:14 +0100)
 * '1 => tempfile' does not work on some versions of Ruby;

 * make sure the system() arg is not passed to the shell.

tools/stack-cleaner/as

index dcdb491..1a66dd3 100755 (executable)
@@ -35,7 +35,9 @@ def wrapped_as(argv)
 
   # Generate temp file
   tempfile = Tempfile.new("as-filter")
-  unless system(File.dirname($0) + "/clean-stack-filter", 0 => input, 1 => tempfile)
+  tempfile.close
+  script = File.dirname($0) + "/clean-stack-filter"
+  unless system([script, script], 0 => input, 1 => tempfile.path)
     status=$?.exitstatus
     FileUtils.rm tempfile
     exit status