summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/relocate.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py
index fb4ff18fae..a6aea329e1 100644
--- a/lib/spack/spack/relocate.py
+++ b/lib/spack/spack/relocate.py
@@ -412,7 +412,8 @@ def replace_prefix_bin(path_name, old_dir, new_dir):
if padding < 0:
return data
return match.group().replace(old_dir.encode('utf-8'),
- new_dir.encode('utf-8')) + b'\0' * padding
+ os.sep.encode('utf-8') * padding +
+ new_dir.encode('utf-8'))
with open(path_name, 'rb+') as f:
data = f.read()