fix(run): quote GAME when writing run.conf #415

Manually merged
github merged 1 commit from github-bot/gh-415 into main 2026-12-04 03:42:20 +00:00 AGit
Owner

@⁠Luxuride on GitHub · 2026-12-04 01:43 UTC · original
Luxuride:fix/run-conf-game-quoting → main · +1 −1 · 1 files · 1 commits · merged 2026-12-04 03:41 UTC

What

First-run setup writes the answer into run.conf as

echo "GAME=$GAME"

run.conf is sourced by env.sh:2, run.sh:120-124, build.sh:3 and setup.sh:7. A dump path containing a space therefore becomes a word split: GAME=/mnt/d/My Dump sources as an assignment plus the command Dump, which fails with Dump: command not found (exit 127), leaves GAME empty, and aborts setup.sh/build.sh under set -euo pipefail. Any shell metacharacter in the path is worse.

One line, using printf %q, which is what makes the value re-sourceable:

printf 'GAME=%q\n' "$GAME"

Validation

old:  /tmp/…/old.conf: line 1: Dump: command not found   (exit 127, GAME empty)
new:  GAME=[/tmp/…/My Dump]                              (exit 0)

Same set -euo pipefail shell both times. The menu's "Save run.conf" (apps/victory panel) copies lines verbatim, so it keeps working.

Overlap check

Not in any open PR or issue: no open PR contains a change to this line or to how run.conf is sourced.

**@⁠Luxuride** on GitHub · 2026-12-04 01:43 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/415) `Luxuride:fix/run-conf-game-quoting` → `main` · +1 −1 · 1 files · 1 commits · merged 2026-12-04 03:41 UTC ## What First-run setup writes the answer into `run.conf` as ```bash echo "GAME=$GAME" ``` `run.conf` is `source`d by `env.sh:2`, `run.sh:120-124`, `build.sh:3` and `setup.sh:7`. A dump path containing a space therefore becomes a word split: `GAME=/mnt/d/My Dump` sources as an assignment plus the command `Dump`, which fails with `Dump: command not found` (exit 127), leaves `GAME` empty, and aborts `setup.sh`/`build.sh` under `set -euo pipefail`. Any shell metacharacter in the path is worse. One line, using `printf %q`, which is what makes the value re-sourceable: ```bash printf 'GAME=%q\n' "$GAME" ``` ## Validation ``` old: /tmp/…/old.conf: line 1: Dump: command not found (exit 127, GAME empty) new: GAME=[/tmp/…/My Dump] (exit 0) ``` Same `set -euo pipefail` shell both times. The menu's "Save run.conf" (`apps/victory` panel) copies lines verbatim, so it keeps working. ## Overlap check Not in any open PR or issue: no open PR contains a change to this line or to how `run.conf` is sourced.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 01:44:02 +00:00
github manually merged commit 6779735fcd into main 2026-12-04 03:42:20 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.