Commit a3cda273 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(setenv): Do something even if process-environment is nil.

parent 0a1dd1c5
......@@ -42,16 +42,19 @@ This function works by modifying `process-environment'."
(let ((pattern (concat "\\`" (regexp-quote (concat variable "="))))
(case-fold-search nil)
(scan process-environment))
(while scan
(cond
((string-match pattern (car scan))
(if (eq nil value)
(setq process-environment (delq (car scan) process-environment))
(setcar scan (concat variable "=" value)))
(setq scan nil))
((null (setq scan (cdr scan)))
(setq process-environment
(cons (concat variable "=" value) process-environment))))))))
(if scan
(while scan
(cond
((string-match pattern (car scan))
(if (eq nil value)
(setq process-environment (delq (car scan) process-environment))
(setcar scan (concat variable "=" value)))
(setq scan nil))
((null (setq scan (cdr scan)))
(setq process-environment
(cons (concat variable "=" value) process-environment)))))
(setq process-environment
(cons (concat variable "=" value) process-environment))))))
(provide 'env)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment