Repository navigation
Keep quotes in answers read by _read and _read_rep - #3076
Merged
Merged
Conversation
_read and _read_rep save the answer with eval "$var_name='$results'", so the answer gets parsed again as shell code inside single quotes, and any answer with a ' in it breaks. In "am -t", a description like "It's a tool" fails with "unexpected EOF while looking for matching" and the script is thrown away with OPERATION ABORTED, an app name like "Bob's App" leaves Name= empty, and a one-line download command loses its quotes. Under dash or busybox sh the same error exits the shell. The template prompts started hitting this when 21a7b3b moved them to _read_rep; _read has had the same line since -y support was added. eval "$var_name=\$results" only expands the variable name and assigns the value as it is, and it's still plain POSIX sh.
sagarrsharmaa
force-pushed
the
fix/template-read-quotes
branch
from
November 25, 2026 15:45
d3f3d44 to
071a675
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_readand_read_repsave the answer witheval "$var_name='$results'", so the answer is parsed again as shell code. Any answer containing a single quote breaks:am -t: a description likeIt's a toolprintsunexpected EOF while looking for matching `''and the script is thrown away with "OPERATION ABORTED!"curl -Ls URL | sed 's/a/b/' | grep -o 'https.*AppImage' | head -1is written to the script with its quotes strippedBob's AppleavesName=empty in the launcher_read_e) the syntax error exits the shellThe template prompts started hitting this in 21a7b3b, when they moved from
read -r -ep ... VARto_read_rep._readhas had the same line since -y support was added, so free-text answers like a custom launch command or a sandbox directory are affected too.eval "$var_name=\$results"expands only the variable name and assigns the value unchanged, and it's still POSIX sh. Two lines changed, no prompts touched.How I tested it: in a Debian container with
am -tand typed answers containing',",$, backslashes and the curl one-liner above, the generated script now contains exactly what was typed. Blank answers, the -y defaults and the category/binary prompts from #3075 behave as before. The helpers also pass under bash, dash and busybox sh,regress/test-am-template-similar.shpasses, andbash -nis clean.