Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit 7c6a9ed

Browse files
committed
fix: [#295] decode file protocol url properly
1 parent b6fa4b7 commit 7c6a9ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/wslview.sh

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ skip_validation_check=${WSLVIEW_SKIP_VALIDATION_CHECK:-1}
44

55
help_short="$0 [-hsvur]\n$0 [-E ENGINE] LINK/FILE"
66

7+
function fileprotocoldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
8+
79
function del_reg_alt {
810
if [ "$distro" == "archlinux" ] || [ "$distro" == "alpine" ]; then
911
error_echo "Unsupported action for this distro. Aborted." 34
@@ -55,6 +57,8 @@ if [[ "$lname" != "" ]]; then
5557
# file:/// protocol used in linux
5658
if [[ "$lname" =~ ^file:\/\/.*$ ]] && [[ ! "$lname" =~ ^file:\/\/(\/)+[A-Za-z]\:.*$ ]]; then
5759
debug_echo "Received file:/// protocol used in linux"
60+
# convert before set
61+
lname="$(fileprotocoldecode "$lname")"
5862
[ "$wslutmpbuild" -ge "$BN_MAY_NINETEEN" ] || error_echo "This protocol is not supported before version 1903." 34
5963
properfile_full_path="$(readlink -f "${lname//file:\/\//}")"
6064
# Linux absolute path

0 commit comments

Comments
 (0)