Backslash escaping in CFlags is parsed incorrectly #163
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ariadne/pkgconf#163
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
The following cflags representations are equivalent according to the shell quoting rules:
This assumption is confirmed by ‘pkg-config --cflags’, that prints them all the same:
However, pkgconf (latest master) prints them all differently:
It’s a valid choice to print the flag single-quoted (in contrast to pkg-config) in the presence of spaces, but it still should be printed the same for all 3 cases:
I think that the problem starts in libpkgconf at the stage of parsing flags string into the list of pkgconf_fragment_t structures. The resulted pkgconf_fragment_t objects contains the following data for the above cases:
This looks broken, as the library client could expect all 3 forms to result in the same (most natural “fully unescaped/unquoted”) internal representation:
Yes, there seems to be more escape-related deficiencies.
Sigh, I will deal with that tonight.