Fix crash in integrate-install powershell#965
Conversation
| .string_arg("Bypass") | ||
| .string_arg("-Command") | ||
| .string_arg(fmt::format("& {& '{}' }", script_path)); | ||
| .string_arg(fmt::format("& {{& '{}' }}", script_path)); |
There was a problem hiding this comment.
Thank you for improving the identification of the fmt library. :)
For the modified content: I think it is to enable the fnt library to correctly identify a situation:
If script_path contains regular '{}', these braces will not be incorrectly recognized as placeholders in the formatted string.
eg: script_path: "/path/to/my{}script"
Before: "& /path/to/myscript"
After: "/path/to/my{}script"
Of course, using double curly braces also conforms to the escape rules of the fmt library.
But you mentioned that microsoft/vcpkg#30283 can be fixed, but I don't see such a problem in the path provided.
Can you explain it? :)
There was a problem hiding this comment.
The previous code was Strings::format("& {& '%s' }", script_path), so the %s should be replaced. But in the fmt lib {} gets replaced and if you want to use a { or } without replacement, you have to double them. That was done here.
|
Thanks! |
Fixes microsoft/vcpkg#30283