summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Olofsson <pelle@pqz.se>2015-10-05 20:55:09 +0200
committerPer Olofsson <pelle@debian.org>2015-10-05 20:55:09 +0200
commit4005de3ec4fb74ce9de0848882722fa220bc3e2e (patch)
tree2635ad10fd27ef114c6a4dd69b39bfad00f396aa
parent84cd704df387add7d2c0a2eaf23b494ba7727470 (diff)
xdg-open: Add proper quoting so that files with spaces in their names can be opened in generic mode and LXDE
-rw-r--r--ChangeLog2
-rw-r--r--scripts/xdg-open.in6
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a7b60e..f96bd89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
* xdg-open: Fix regression in generic mode (wrong variable name) which
prevented files from being opened using the desktop file/mimeapps.list
mechanism.
+ * xdg-open: Add proper quoting so that files with spaces in their names
+ can be opened in generic mode and LXDE.
=== xdg-utils 1.1.0 ===
2015-10-04 Per Olofsson <pelle@debian.org>
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
index a6eaaab..0fbd63d 100644
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
@@ -83,7 +83,7 @@ is_file_url_or_path()
# If not, leave it as it is.
file_url_to_path()
{
- local file=$1
+ local file="$1"
if echo "$file" | grep -q '^file:///'; then
file=${file#file://}
file=${file%%#*}
@@ -344,7 +344,7 @@ open_envvar()
open_generic()
{
if is_file_url_or_path "$1"; then
- local file=$(file_url_to_path "$1")
+ local file="$(file_url_to_path "$1")"
check_input_file "$file"
@@ -393,7 +393,7 @@ open_lxde()
{
# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
if is_file_url_or_path "$1"; then
- local file=$(file_url_to_path "$1")
+ local file="$(file_url_to_path "$1")"
# handle relative paths
if ! echo "$file" | grep -q ^/; then