Skip to content

Commit

Permalink
misc: replace NEW_WINEPREFIX with LAST_WINEPREFIX
Browse files Browse the repository at this point in the history
The winetricks_set_wineprefix function needs to run at least once even
if WINEPREFIX was already set in the environment before running
winetricks.

This partially reverts commit 21f2f73.

Fixes #2325
  • Loading branch information
alexhenrie committed Jan 22, 2025
1 parent e38a661 commit dadddad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -4361,17 +4361,17 @@ winetricks_set_wineprefix()
# Note: these are arch independent, but are needed by some arch dependent variables
# Defining here to avoid having two arch checks:
if ! test "$1"; then
NEW_WINEPREFIX="${WINETRICKS_ORIGINAL_WINEPREFIX}"
WINEPREFIX="${WINETRICKS_ORIGINAL_WINEPREFIX}"
else
NEW_WINEPREFIX="${W_PREFIXES_ROOT}/$1"
WINEPREFIX="${W_PREFIXES_ROOT}/$1"
fi

if test "${WINEPREFIX}" = "${NEW_WINEPREFIX}"; then
if test "${WINEPREFIX}" = "${LAST_WINEPREFIX}"; then
# A previous verb already set the prefix
return
fi

WINEPREFIX="${NEW_WINEPREFIX}"
LAST_WINEPREFIX="${WINEPREFIX}"
export WINEPREFIX
w_try_mkdir "$(dirname "${WINEPREFIX}")"

Expand Down

0 comments on commit dadddad

Please sign in to comment.