;;; env.el --- functions to manipulate environment variables
-;; Copyright (C) 1991, 1994, 2000-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2000-2013 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: processes, unix
(defvar setenv-history nil)
(defconst env--substitute-vars-regexp
- (rx "$"
- (or (submatch-n 1 (1+ (regexp "[[:alnum:]_]")))
- (and "{" (submatch-n 1 (minimal-match (0+ anything))) "}")
- "$")))
+ "\\$\\(?:\\(?1:[[:alnum:]_]+\\)\\|{\\(?1:[^{}]+\\)}\\|\\$\\)")
(defun substitute-env-vars (string &optional only-defined)
"Substitute environment variables referred to in STRING.