Skip to content

Commit 6a9ff6a

Browse files
committed
qb: fix config.params.sh parser break from 41dd469 + harden parser
Commit 41dd469 added a three-line '#' comment block above the new HAVE_RETROARCH_PLAYLIST_MANAGER entry in qb/config.params.sh: # RetroArchPlaylistManager (iOS/tvOS playlist helper, also fine on # modern macOS). Auto-disabled on pre-10.11 macOS targets by # config.libs.sh because the file uses Xcode 7-era Obj-C syntax. HAVE_RETROARCH_PLAYLIST_MANAGER=auto which breaks configure with: qb/qb.params.sh: line 102: USER_#=auto: command not found qb/config.params.sh is parsed line-by-line by parse_input() using a plain 'while read -r VAR _' - '#' is not a comment introducer in that loop, it's just the first whitespace-separated token of a data line. On each '#' line, VAR becomes '#', TMPVAR becomes '#', NEWVAR becomes '#', and 'eval "USER_$NEWVAR=auto"' tries to run 'USER_#=auto' as a command. The whole file's convention is inline comments on HAVE_X=... lines only; no standalone '#' lines existed before this one. Two changes: qb/config.params.sh: fold the multi-line comment into a single inline '#' comment on the assignment line, matching the rest of the file. qb/qb.params.sh: harden parse_input() to skip blank lines and '#'-starting lines up front. This doesn't change behaviour on today's well-formed file, but prevents the same foot-gun from biting anyone else who adds a comment block.
1 parent 41dd469 commit 6a9ff6a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

qb/config.params.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,5 @@ HAVE_GAME_AI=no
215215
HAVE_SMBCLIENT=auto # SMB client support
216216
HAVE_BUILTINSMBCLIENT=no # Use builtin libsmb2
217217
HAVE_COCOA=auto # Cocoa support (Darwin/Apple)
218-
# RetroArchPlaylistManager (iOS/tvOS playlist helper, also fine on
219-
# modern macOS). Auto-disabled on pre-10.11 macOS targets by
220-
# config.libs.sh because the file uses Xcode 7-era Obj-C syntax.
221-
HAVE_RETROARCH_PLAYLIST_MANAGER=auto
218+
HAVE_RETROARCH_PLAYLIST_MANAGER=auto # iOS/tvOS + macOS 10.11+ playlist helper (see qb/config.libs.sh)
222219
HAVE_MFI=auto # GameController.framework joypad support (Apple)

qb/qb.params.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ parse_input() # Parse stuff :V
9393
config_opts='./configure'
9494

9595
while read -r VAR _; do
96+
# Skip blank lines and comment-only lines. Only HAVE_* or
97+
# bare-name=VALUE assignments are meaningful here; anything
98+
# else (like "# comment") would produce a broken eval such
99+
# as 'USER_#=auto'.
100+
case "$VAR" in
101+
''|'#'*) continue ;;
102+
esac
96103
TMPVAR="${VAR%=*}"
97104
NEWVAR="${TMPVAR##HAVE_}"
98105
OPTS="${OPTS} $NEWVAR"

0 commit comments

Comments
 (0)