summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-03-27 11:57:44 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-03-27 12:01:56 -0700
commit589a4034b7af522c5b8107d5089fb1aec523a1e4 (patch)
tree95a0624a0c92c7d838a613701cc980a01519c45a
parent84c7c6fd2b9604fa28e0b834caa46423114b9c5b (diff)
downloademacs-589a4034b7af522c5b8107d5089fb1aec523a1e4.tar.gz
Port user-login-name initialization to Qnil == 0
* editfns.c (Fuser_login_name, Fuser_real_login_name) (syms_of_editfns): Don't rely on all-bits-zero being an Elisp integer, as this is no longer true now that Qnil == 0.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/editfns.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3f9ab4fff43..61f2a84a9f9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2015-03-27 Paul Eggert <eggert@cs.ucla.edu>
+ Port user-login-name initialization to Qnil == 0
+ * editfns.c (Fuser_login_name, Fuser_real_login_name)
+ (syms_of_editfns): Don't rely on all-bits-zero being an Elisp integer,
+ as this is no longer true now that Qnil == 0.
+
Assume !BROKEN_NON_BLOCKING_CONNECT
From a suggestion by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00824.html
diff --git a/src/editfns.c b/src/editfns.c
index f463890a98d..7d3e4620029 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1191,7 +1191,7 @@ of the user with that uid, or nil if there is no such user. */)
/* Set up the user name info if we didn't do it before.
(That can happen if Emacs is dumpable
but you decide to run `temacs -l loadup' and not dump. */
- if (INTEGERP (Vuser_login_name))
+ if (NILP (Vuser_login_name))
init_editfns ();
if (NILP (uid))
@@ -1214,7 +1214,7 @@ This ignores the environment variables LOGNAME and USER, so it differs from
/* Set up the user name info if we didn't do it before.
(That can happen if Emacs is dumpable
but you decide to run `temacs -l loadup' and not dump. */
- if (INTEGERP (Vuser_login_name))
+ if (NILP (Vuser_login_name))
init_editfns ();
return Vuser_real_login_name;
}
@@ -4955,6 +4955,7 @@ functions if all the text being accessed has this property. */);
DEFVAR_LISP ("user-login-name", Vuser_login_name,
doc: /* The user's name, taken from environment variables if possible. */);
+ Vuser_login_name = Qnil;
DEFVAR_LISP ("user-real-login-name", Vuser_real_login_name,
doc: /* The user's name, based upon the real uid only. */);