瀏覽代碼

load_env: Use double backslashes for escaping

Huidae Cho 5 年之前
父節點
當前提交
90a2302a19
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/init/grass.py

+ 1 - 1
lib/init/grass.py

@@ -1179,7 +1179,7 @@ def load_env(grass_env_file):
             debug("Ignore multi-line environmental variable {0}".format(k))
             debug("Ignore multi-line environmental variable {0}".format(k))
             continue
             continue
         if expand:
         if expand:
-            v = os.path.expanduser(os.path.expandvars(v.replace('\$', '\0')).replace('\0', '$'))
+            v = os.path.expanduser(os.path.expandvars(v.replace('\\$', '\0')).replace('\0', '$'))
         debug("Environmental variable set {0}={1}".format(k, v))
         debug("Environmental variable set {0}={1}".format(k, v))
         os.environ[k] = v
         os.environ[k] = v