|
@@ -1160,7 +1160,7 @@ def load_env(grass_env_file):
|
|
|
if not os.access(grass_env_file, os.R_OK):
|
|
|
return
|
|
|
|
|
|
- export_re = re.compile('^export[ \t]+([a-zA-Z_]+[a-zA-Z0-9_]*)=(.*)$')
|
|
|
+ export_re = re.compile('^export[ \t]+([a-zA-Z_]+[a-zA-Z0-9_]*)=(.*?)[ \t]*$')
|
|
|
|
|
|
for line in readfile(grass_env_file).split(os.linesep):
|
|
|
m = export_re.match(line)
|
|
@@ -1176,6 +1176,7 @@ def load_env(grass_env_file):
|
|
|
v = v.strip('"')
|
|
|
elif v.startswith("'") or v.endswith("'") or v.startswith('"') or v.endswith('"'):
|
|
|
# ignore multi-line variables
|
|
|
+ debug("Ignore multi-line environmental variable {0}".format(k))
|
|
|
continue
|
|
|
if expand:
|
|
|
v = os.path.expanduser(os.path.expandvars(v.replace('\$', '\0')).replace('\0', '$'))
|