This fixes a number of bugs in the BITCOIN_SUBDIR_TO_INCLUDE macro:
- tr was deleting all ’n’ and ‘r’ characters in addition to the backslash, due to too much escaping.
- Escaped spaces in paths were ignored, parsing the space as a delimiter
- Multiline output from cpp (used when there are a number of includes being listed) weren’t handled correctly.
The new sed takes two steps:
- Translate escaped newlines into a space, to work with single lines.
- Search for the file we want and return the complete path for it.