-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vcpkg] Do not use raw paths inside regexes #12964
[vcpkg] Do not use raw paths inside regexes #12964
Conversation
vcpkg_fixup_pkgconfig uses raw paths in regexes in a couple of places. This causes problems if the path contains characters with special meaning for regexes (e.g. /home/hypothetical-user/Documents/C++).
Related issue: #12965 |
macos geogram failure didn't repro for me locally, merged with master to try to fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -0,0 +1,4 @@ | |||
function(vcpkg_escape_regex_control_characters out_var string_with_regex_characters) | |||
string(REGEX REPLACE "([][+.*()^\\])" "\\\\\\1" _vercc_out "${string_with_regex_characters}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add '$' '?' '|' here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that.
…criptive variable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanst99 Can you confirm that you are OK with my edit? (Will merge ASAP assuming you like it) Thanks for your contribution!
Thanks for your contribution! |
Co-authored-by: Billy Robert O'Neal <[email protected]>
vcpkg_fixup_pkgconfig uses raw paths in regexes in a couple of places. This causes problems if the path contains characters with special meaning for regexes, e.g. /home/hypothetical-user/Documents/C++, which would fail to compile as it's not a valid regex – causing any invocation of this script to fail if vcpkg is on such a path.