diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-02-15 23:26:43 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-02-15 23:26:43 +0000 |
commit | cc1e71a2ac090488f0b1fb371bdd570f036ee932 (patch) | |
tree | f57f26da7988240677136269eebe691fa5595574 /tools/win-setup.sh | |
parent | f3e871e6599f1fa94dfb04a31ceb02326a4cb235 (diff) |
The problem was that if you do, for example:
foo=`echo`
$foo won't be empty, it'll include the newline at the end of the output
of "echo". The same applies for any other command; strip newlines from
the output of regtool to avoid that problem.
svn path=/trunk/; revision=31889
Diffstat (limited to 'tools/win-setup.sh')
-rwxr-xr-x | tools/win-setup.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/win-setup.sh b/tools/win-setup.sh index 286735cb30..1618ab9fd5 100755 --- a/tools/win-setup.sh +++ b/tools/win-setup.sh @@ -54,9 +54,12 @@ find_proxy() { fi # ...and wget can't fetch two registry keys because...? - proxy_enabled=`regtool get /HKCU/Software/Microsoft/Windows/CurrentVersion/Internet\ Settings/ProxyEnable 2>/dev/null` -echo "proxy_enabled is:" -echo "$proxy_enabled" | od -bc + # + # If regtool prints a blank line, $proxy_enabled will + # not be a zero-length string, it'll be a newline. + # Strip out newlines so that doesn't happen. + # + proxy_enabled=`regtool get /HKCU/Software/Microsoft/Windows/CurrentVersion/Internet\ Settings/ProxyEnable 2>/dev/null | tr -d '\012'` if [ -n "$proxy_enabled" -a "$proxy_enabled" -ne 0 ] ; then export http_proxy=`regtool get /HKCU/Software/Microsoft/Windows/CurrentVersion/Internet\ Settings/ProxyServer 2>/dev/null` echo "Using Internet Explorer proxy settings." |