Skip to content

Commit

Permalink
Trim trailing whitespace when querying shell for $PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Feb 9, 2011
1 parent c633147 commit 473354a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion init-exec-path.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))
(let ((path-from-shell (replace-regexp-in-string
"[ \t\n]*$"
""
(shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))

Expand Down

0 comments on commit 473354a

Please sign in to comment.