Skip to content

Commit

Permalink
Fix IFS construction in test helper scripts
Browse files Browse the repository at this point in the history
Since command substitution strips away all trailing whitespace, we need
to print a non-whitespace character at the end of the sequence and later
remove it.
  • Loading branch information
jmc-88 committed Jan 9, 2022
1 parent b608433 commit c13be91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/Xnest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Not quite the "unofficial BASH strict mode", but better than nothing.
set -eu
IFS="$(printf '\n\t')"
IFS="$(printf '\t\n.')"
IFS="${IFS%?}"

# Simple test script to launch the locally-built tint3 and the Openbox window
# manager in a nested X session.
Expand Down
3 changes: 2 additions & 1 deletion test/xvfb-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Not quite the "unofficial BASH strict mode", but better than nothing.
set -eu
IFS="$(printf '\n\t')"
IFS="$(printf '\t\n.')"
IFS="${IFS%?}"

# Simple wrapper around Xvfb, used to run some test programs in a virtual X
# server. Provides a minimal replacement for xvfb-run which isn't universally
Expand Down

0 comments on commit c13be91

Please sign in to comment.