From d5a1eeaebeb6af8f2eef494b260a6cb742013fda Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Tue, 11 Nov 2008 16:25:21 +0000 Subject: some latin1 tests, debug it::exec --- it.class | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'it.class') diff --git a/it.class b/it.class index 83532a8..5c8ec24 100644 --- a/it.class +++ b/it.class @@ -395,6 +395,9 @@ function exec(/* $cmd, $values1 = array(), ... */) foreach ($args as $arg) $values += (array)$arg; + #for escapeshellarg in it::_exec_quotevalue + $oldlocale = setlocale( LC_CTYPE, 0 ); + setlocale(LC_CTYPE, 'de_CH'); while (list($tag, $option, $key) = it::match('({(-?)(\w+)})', $cmd)) { $parts = array(); @@ -417,17 +420,19 @@ function exec(/* $cmd, $values1 = array(), ... */) $cmd = str_replace($tag, join(" ", $parts), $cmd); } + setlocale(LC_CTYPE, $oldlocale); $s = gettimeofday(); $result = EDC('noexec') ? "" : (string)shell_exec($cmd); $e = gettimeofday(); $msec= intval(($e['sec'] - $s['sec']) * 1000 + ($e['usec'] - $s['usec']) / 1000); - it::log('exec', "$msec\t$cmd"); + @it::log('exec', "$msec\t$cmd"); return $result; } +#fails with C locale!!! function _exec_quotevalue($value) { $result = strval($value); -- cgit v1.2.3