# HG changeset patch # User Richard M. Stallman # Date 772258058 0 # Node ID f8c8bbeca971da3d8be7619b3794d9fd74a098de # Parent 1a6bff2bc0e7b81fd65ed17564ede55e9691f6ea (setenv): Do something even if process-environment is nil. diff -r 1a6bff2bc0e7 -r f8c8bbeca971 lisp/env.el --- a/lisp/env.el Tue Jun 21 20:49:12 1994 +0000 +++ b/lisp/env.el Wed Jun 22 04:07:38 1994 +0000 @@ -42,16 +42,19 @@ (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)