summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2020-03-16 14:49:55 -0500
committerGitHub <noreply@github.com>2020-03-16 14:49:55 -0500
commit3029dde7ec96a33769d420f6b1f5c58086795931 (patch)
tree1aaa7dffa0f336d69b5f5212f67e052b1f488198
parenta8706cc89b49fadadc644cdbb7077743fcc58b4b (diff)
downloadspack-3029dde7ec96a33769d420f6b1f5c58086795931.tar.gz
spack-3029dde7ec96a33769d420f6b1f5c58086795931.tar.bz2
spack-3029dde7ec96a33769d420f6b1f5c58086795931.tar.xz
spack-3029dde7ec96a33769d420f6b1f5c58086795931.zip
When replacing path text in ELF binaries do not include null byte padding in search string (#15508)
-rw-r--r--lib/spack/spack/relocate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py
index 7a36434736..e7c85fa4d9 100644
--- a/lib/spack/spack/relocate.py
+++ b/lib/spack/spack/relocate.py
@@ -447,7 +447,7 @@ def replace_prefix_bin(path_name, old_dir, new_dir):
data = f.read()
f.seek(0)
original_data_len = len(data)
- pat = re.compile(old_dir.encode('utf-8') + b'([^\0]*?)\0')
+ pat = re.compile(old_dir.encode('utf-8'))
if not pat.search(data):
return
ndata = pat.sub(replace, data)