aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMarcelo Leitner <mrl@mandriva.com>2007-03-20 14:29:16 +0000
committerMarcelo Leitner <mrl@mandriva.com>2007-03-20 14:29:16 +0000
commit127847aa449793f3f3262264a3d8c30869084b68 (patch)
tree14f7949d10484a93df07e5fa38a4fe084b7685f6 /bin
parent7e7f1bea2dcae280990c418b13b98083ffd25344 (diff)
downloadcommon-data-127847aa449793f3f3262264a3d8c30869084b68.tar
common-data-127847aa449793f3f3262264a3d8c30869084b68.tar.gz
common-data-127847aa449793f3f3262264a3d8c30869084b68.tar.bz2
common-data-127847aa449793f3f3262264a3d8c30869084b68.tar.xz
common-data-127847aa449793f3f3262264a3d8c30869084b68.zip
- Adds lock system to avoid recursive calls between xdg-open and www-browser.
Closes: #29599
Diffstat (limited to 'bin')
-rwxr-xr-xbin/www-browser13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/www-browser b/bin/www-browser
index 38e99ef..8af1c36 100755
--- a/bin/www-browser
+++ b/bin/www-browser
@@ -10,9 +10,11 @@
#---------------------------------------------------------------
#
-# If we got any argument, we can call xdg-open
+# If we got any argument, we can call xdg-open, if we havenĀ“t already done it
#
-if [[ -n "$@" ]]; then
+if [ -n "$@" -a -z "$THROUGHXDG" ]; then
+ # Lock against bug #29599
+ export THROUGHXDG=1
exec xdg-open "$@"
fi
@@ -67,7 +69,12 @@ if [[ -z "$BROWSER" ]]; then
fi
if [[ -n "$BROWSER" ]]; then
- exec $BROWSER
+ if [[ -n "$THROUGHXDG" ]]; then
+ # xdg couldn't handle the url
+ exec $BROWSER $@
+ else
+ exec $BROWSER
+ fi
else
echo "no web browser detected"
fi