summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/project.py b/project.py
index 2112ee32..99ef238f 100644
--- a/project.py
+++ b/project.py
@@ -275,7 +275,12 @@ def _SafeExpandPath(base, subpath, skipfinal=False):
275 NB: We rely on a number of paths already being filtered out while parsing the 275 NB: We rely on a number of paths already being filtered out while parsing the
276 manifest. See the validation logic in manifest_xml.py for more details. 276 manifest. See the validation logic in manifest_xml.py for more details.
277 """ 277 """
278 components = subpath.split(os.path.sep) 278 # Split up the path by its components. We can't use os.path.sep exclusively
279 # as some platforms (like Windows) will convert / to \ and that bypasses all
280 # our constructed logic here. Especially since manifest authors only use
281 # / in their paths.
282 resep = re.compile(r'[/%s]' % re.escape(os.path.sep))
283 components = resep.split(subpath)
279 if skipfinal: 284 if skipfinal:
280 # Whether the caller handles the final component itself. 285 # Whether the caller handles the final component itself.
281 finalpart = components.pop() 286 finalpart = components.pop()