summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennard Hofmann <lennard.hofmann@web.de>2023-08-22 10:25:53 +0200
committerLennard Hofmann <lennard.hofmann@web.de>2023-08-22 10:25:53 +0200
commitc22a09fc4f2d676404b4cf3ef27294aec7c8c09f (patch)
tree3a56585c2a732d5d091153e052d50e5719996639
parent301a1a4772f1f934a22e106ff032c62ef705462b (diff)
xdg-email: do not run BROWSER if xdg-open failed
Removed code that was 1. redundant since xdg-open already tries different browsers 2. broken (if you set BROWSER="firefox %s", it will not wordsplit correctly but try to run an executable named "firefox mailto") 3. potentially dangerous: https://bugs.freedesktop.org/show_bug.cgi?id=103807
-rw-r--r--scripts/xdg-email.in26
1 files changed, 1 insertions, 25 deletions
diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
index dfb4b83..43ddfcc 100644
--- a/scripts/xdg-email.in
+++ b/scripts/xdg-email.in
@@ -249,31 +249,7 @@ open_generic()
fi
xdg-open "$1"
- local ret=$?
-
- # 3 means exit_failure_operation_impossible
- if [ $ret != 3 ]; then
- exit $ret
- fi
-
- IFS=":"
- for browser in $BROWSER; do
- if [ x"$browser" != x"" ]; then
-
- browser_with_arg=`printf "$browser" "$1" 2>/dev/null`
- if [ $? -ne 0 ]; then browser_with_arg=$browser;
- fi
-
- if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
- else $browser_with_arg;
- fi
-
- if [ $? -eq 0 ]; then exit_success;
- fi
- fi
- done
-
- exit_failure_operation_impossible "no method available for opening '$1'"
+ exit $?
}
url_encode()