fix overzealous replace in wrappers pathnames (#415)

Wrapper filenames were generated by replacing ".c" with "_private.h".
Unfortunately this matched anywhere in the string, causing problems if
the path contained a directory containing the substring ".c". For
instance, if box64 is compiled in a '.cache' directory (as AUR helpers
like to do, see #144), the directory name was inadvertently mangled
into '_private.hache'.

Fix this by restricting the match to the end of the string.
This commit is contained in:
Jonathan Keller 2022-09-30 11:28:46 -07:00 committed by GitHub
parent 7b67bbe698
commit 1c110080a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,7 @@ set(WRAPPEDS
#set(WRAPPEDS_HEAD "${BOX64_ROOT}/src/wrapped/wrappedd3dadapter9_gen.h")
foreach(A ${WRAPPEDS})
string(REPLACE ".c" "_private.h" B ${A})
string(REGEX REPLACE ".c$" "_private.h" B ${A})
set(WRAPPEDS_HEAD ${WRAPPEDS_HEAD} ${B})
set_source_files_properties(${A} PROPERTIES OBJECT_DEPENDS ${B})
endforeach()