From 71a3e8316f5bb04b849d184e3ac27cabe6d4e162 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 15 Jul 2019 14:34:21 +0200 Subject: [PATCH] scs #13189: oubli report --- src/fileEnviron.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/fileEnviron.py b/src/fileEnviron.py index 468b0e8..851b7c9 100644 --- a/src/fileEnviron.py +++ b/src/fileEnviron.py @@ -615,8 +615,18 @@ class LauncherFileEnviron: :param value str: the value to prepend to key :param sep str: the separator string """ - for c in [";", ":"]: # windows or linux path separators - if c in value: + separators = [] + if src.architecture.is_windows(): + separators = [':'] + else: + separators = [';'] + for c in separators: # windows or linux path separators + isOK = True + if c in value and not src.architecture.is_windows(): + isOK = False + elif c in value and src.architecture.is_windows() and value.count(':') > 1: + isOK = False + if not isOK: raise Exception("LauncherFileEnviron prepend key '%s' value '%s' contains forbidden character '%s'" % (key, value, c)) if self.is_defined(key) : self.add(key, value) -- 2.39.2