summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorNathan Gass2008-11-11 16:25:21 +0000
committerNathan Gass2008-11-11 16:25:21 +0000
commitd5a1eeaebeb6af8f2eef494b260a6cb742013fda (patch)
tree6a8271581e3b2db73aecc9c7f5c02946cc6f3372 /it.class
parenta4016e0ab074ca7432b8a01929d29c4a5505b6d8 (diff)
downloaditools-d5a1eeaebeb6af8f2eef494b260a6cb742013fda.tar.gz
itools-d5a1eeaebeb6af8f2eef494b260a6cb742013fda.tar.bz2
itools-d5a1eeaebeb6af8f2eef494b260a6cb742013fda.zip
some latin1 tests, debug it::exec
Diffstat (limited to 'it.class')
-rw-r--r--it.class7
1 files changed, 6 insertions, 1 deletions
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);