Skip to content

Commit 2c69bfa

Browse files
committed
use convertpath() less often for $Xcookie #7
1 parent a63b07b commit 2c69bfa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

runx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22
# runx: Provide an X server in Cygwin, MSYS2 or WSL.
33

4-
Version="v0.4.14"
4+
Version="v0.4.15"
55

66
usage() { # Usage information (--help)
77
echo "runx - Run Linux GUI applications on MS Windows.
@@ -467,8 +467,8 @@ generate_xcommand() { # Generate command to start X server VcXsrv
467467
case $Xauthentication in
468468
yes)
469469
case "$Xserver" in
470-
xwin) Xcommand="$Xcommand -auth '$(convertpath subsystem "$Xcookie")'" ;;
471-
vcxsrv) Xcommand="$Xcommand -auth '$(convertpath windows "$Xcookie")'" ;;
470+
xwin) Xcommand="$Xcommand -auth '$Xcookie'" ;;
471+
vcxsrv) Xcommand="$Xcommand -auth '$(convertpath windows "$Xcookie")'" ;;
472472
esac ;;
473473
no) Xcommand="$Xcommand -ac" ;;
474474
esac
@@ -496,12 +496,12 @@ setup_cookie() { # Generate X authentication cookie
496496
command -v tasklist.exe >/dev/null && {
497497
tasklist.exe | rmcr | grep -q -E 'vcxsrv.exe|XWin.exe' || {
498498
verbose "Removing old cookies."
499-
[ -e "$(convertpath subsystem "$Xcookie")" ] && rm "$(convertpath subsystem "$Xcookie")"
499+
[ -e "$Xcookie" ] && rm "$Xcookie"
500500
}
501501
}
502502

503503
# avoid missing file message of xauth
504-
touch "$(convertpath subsystem "$Xcookie")"
504+
touch "$Xcookie"
505505

506506
# check for native xauth, otherwise use xauth.exe from VcXsrv
507507
Xauthbin="$(command -v xauth)"
@@ -536,7 +536,7 @@ $Xauthbin \"$@\"
536536
https://github.com/mviereck/runx/issues/7
537537
If it fails, you can use option --no-auth as a workaround."
538538
cookiebaker $Hostip:$Newdisplaynumber > $Xcookie.tmp
539-
cat $Xcookie.tmp >> "$(convertpath subsystem "$Xcookie")"
539+
cat $Xcookie.tmp >> "$Xcookie"
540540
rm $Xcookie.tmp
541541
}
542542
}
@@ -599,7 +599,7 @@ cleanup() { # --cleanup: Terminate X servers, delete cookies
599599
MSYS2_ARG_CONV_EXCL='*' taskkill.exe /F /PID xwin.exe
600600
# Remove cookies
601601
Newdisplaynumber=0
602-
rm -v "$(convertpath subsystem "$Xcookie")"
602+
rm -v "$Xcookie"
603603
}
604604

605605
### main
@@ -739,7 +739,7 @@ main() {
739739
Xcookie="$(convertpath subsystem "$(MSYS2_ARG_CONV_EXCL='*' cmd.exe /C "echo %userprofile%")" | rmcr)/Xauthority.runx"
740740
case "$Xauthentication" in
741741
yes)
742-
XAUTHORITY="$(convertpath subsystem "$Xcookie")"
742+
XAUTHORITY="$Xcookie"
743743
verbose "DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY"
744744
note "If you get application error messages like 'Cannot open display'
745745
or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.

0 commit comments

Comments
 (0)