From 53e217fca6cb06b99df066de136f008f3be608ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sat, 20 Feb 2016 15:10:53 +0200 Subject: [PATCH] Add a patchup script to fix up after potentially unwanted changes from bug https://github.com/kripken/emscripten/issues/4121. --- emsdk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emsdk b/emsdk index 3dd6e41..75f0ee3 100755 --- a/emsdk +++ b/emsdk @@ -1464,6 +1464,17 @@ def adjusted_path(tools_to_activate, log_additions=False, system_path_only=False existing_path = win_get_environment_variable('PATH', system=True) if not system_path_only: existing_path += ENVPATH_SEPARATOR + win_get_environment_variable('PATH', system=False) existing_path = existing_path.split(ENVPATH_SEPARATOR) + + # Fix up after potential changes made by bug https://github.com/kripken/emscripten/issues/4121 + system_root = os.environ['SystemRoot'].lower() + for i in range(len(existing_path)): + p = existing_path[i] + if p.lower() == system_root: p = '%SystemRoot%' + elif (system_root + '\\system32') in p.lower(): p = '%SystemRoot%\\system32' + elif (system_root + '\\system32\\wbem') in p.lower(): p = '%SystemRoot%\\System32\\Wbem' + elif (system_root + '\\system32\\windowspowershell\v1.0') in p.lower(): p = '%SystemRoot%\\System32\\WindowsPowerShell\v1.0\\' + existing_path[i] = p + else: existing_path = os.environ['PATH'].split(ENVPATH_SEPARATOR) emsdk_root_path = to_unix_path(emsdk_path())