summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2014-01-26 01:12:45 -0300
committerBrian Fraser <fraserbn@gmail.com>2014-01-26 14:44:26 -0300
commitbb34e29a07123d6f8b23fd8df7efe347907f45e0 (patch)
treefeca625f8703de1e46b4b77200469db1d971bc3c /hints
parent8d6f7939bfc611dedd9b5c694563ca08c063d5fc (diff)
downloadperl-bb34e29a07123d6f8b23fd8df7efe347907f45e0.tar.gz
Android hints: run-adb-shell was mishandling '\0'
That's literally '\0', all four characters, not a null. Previously, due to mistakenly passing things through the shell twice, it turned '\0' into an actual null, and that screwed up the test for fflush(NULL)
Diffstat (limited to 'hints')
-rw-r--r--hints/linux-android.sh21
1 files changed, 9 insertions, 12 deletions
diff --git a/hints/linux-android.sh b/hints/linux-android.sh
index 7086d47d93..76cfceb7a0 100644
--- a/hints/linux-android.sh
+++ b/hints/linux-android.sh
@@ -191,25 +191,22 @@ $to \$exe > /dev/null 2>&1
# sometimes there is no $?, I dunno why? we then get Cross/run-adb-shell: line 39: exit: XX: numeric argument required
adb -s $targethost shell "sh -c '(cd \$cwd && \$env ; \$exe \$args > $targetdir/output.stdout 2>$targetdir/output.stderr) ; \$doexit '" > /dev/null
+rm output.stdout output.stderr output.status 2>/dev/null
+
$from output.stdout
$from output.stderr
$from output.status
-result=\`$cat output.stdout\`
-result_err=\`$cat output.stderr\`
-result_status=\`$cat output.status\`
-rm output.stdout output.stderr output.status
-
# We get back Ok\r\n on android for some reason, grrr:
-result=\`echo "\$result" | $tr -d '\r'\`
-result_err=\`echo "\$result_err" | $tr -d '\r'\`
-result_status=\`echo \$result_status | $tr -d '\r'\`
-
-echo "\$result"
-if test "X\$result_err" != X; then
- echo "\$result_err" >&2
+$cat output.stdout | $tr -d '\r'
+if test -s output.stderr; then
+ $cat output.stderr | $tr -d '\r' >&2
fi
+result_status=\`$cat output.status | $tr -d '\r'\`
+
+rm output.stdout output.stderr output.status
+
# Also, adb doesn't exit with the commands exit code, like ssh does, double-grr
exit \$result_status