/ curl Public
configure: fix broken m4 syntax in TLS options #9344
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.
Commit b589696 added lines to some shell within AC_ARG_WITH macros, but
inadvertently failed to move the final closing ). e.g.:
This generates a broken looking configure script:
But amazingly, it executes OK, due to balancing " quotes and if/fi, as
you can see if you reformat the white space:
We move the closing ) back to the end of the section of script:
However, with this change alone the generated configure script is still broken:
This is because there is an unquoted comma in the script,
unintentionally separating AC_ARG_WITH arguments. We need to quote the
script section using braces:
The generated script now has sane shell syntax:
However, the 'test -z "TLSCHOICE" ||' part is a no-op, the same as
'false ||'. Perhaps it was cut-and-pasted from somewhere else, and a
dollar before TLSCHOICE was accidentaly deleted. However, with that
change, TLSCHOICE would never be set.
The code on the rhs of the || makes sense - it appends the new value,
separating it from any previous value with ", ". So, we can simplify by
removing the no-op test. This gives us:
As far as I can tell, the quoting problem and no-op test have been there
for as long as this code has existed.
So, if these problems have been around for a while, how did I find them?
Only because I did a configure including these options:
and got this diagnostic at the end:
WARNING: rustls enabled but marked EXPERIMENTAL. Use with caution!
I've tested these changes by running various combinations of options,
and checking that the diagnostic at the end prints correctly. e.g.: