about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJonathan Keller <19418817+NobodyNada@users.noreply.github.com>2022-09-30 11:28:46 -0700
committerGitHub <noreply@github.com>2022-09-30 20:28:46 +0200
commit1c110080a8b8ac080f6ecb9e6c029a9c790bd479 (patch)
treee1c0784287f0dfbda6d6cf339b5dedd04a317c3b
parent7b67bbe6988d00d557d72c9867b99826320d1835 (diff)
downloadbox64-1c110080a8b8ac080f6ecb9e6c029a9c790bd479.tar.gz
box64-1c110080a8b8ac080f6ecb9e6c029a9c790bd479.zip
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.
-rwxr-xr-xCMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 781943b6..852f0d80 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()