Skip to content

Commit

Permalink
tests/tilde-p: Honor logname utility only if succeeds
Browse files Browse the repository at this point in the history
On WSL, the logname utility fails, but the LOGNAME environment variable
still holds a valid login name. We should overwrite the variable only
when the logname utility returned a non-empty result.

This change should avoid skipping test cases unnecessarily.
  • Loading branch information
magicant committed Nov 20, 2024
1 parent d306b74 commit c080f2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/tilde-p.tst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ __IN__

(
if
! { LOGNAME="$(logname)" && export LOGNAME; }
logname=$(logname)
if [ "$logname" ]; then LOGNAME=$logname; fi
unset logname
! { [ "$LOGNAME" ] && export LOGNAME; }
then
skip="true"
elif
Expand Down

0 comments on commit c080f2e

Please sign in to comment.