Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] doesn't open files with option names #11

Open
averms opened this issue Jul 25, 2019 · 0 comments
Open

[bug] doesn't open files with option names #11

averms opened this issue Jul 25, 2019 · 0 comments

Comments

@averms
Copy link

averms commented Jul 25, 2019

If I have a file with -h as the name it won't open. The below patch fixes this problem.

diff --git a/xdg-open b/xdg-open
index a30b3ec..2a318df 100755
--- a/xdg-open
+++ b/xdg-open
@@ -73,7 +73,7 @@ fi
 
 if [[ -e "$arg" ]]; then
 	# file or dir
-	mime="$(file -ib "$arg" | cut -d';' -f1)"
+	mime="$(file -ib -- "$arg" | cut -d';' -f1)"
 	if [[ -f "$arg" ]]; then
 		ext="$(tr '[:upper:]' '[:lower:]' <<< "${arg##*.}")"
 	fi
BachoSeven added a commit to BachoSeven/mimi that referenced this issue Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant