[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src editfns.c
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs/src editfns.c |
Date: |
Wed, 18 Mar 2009 20:37:06 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Eli Zaretskii <eliz> 09/03/18 20:37:06
Modified files:
src : editfns.c
Log message:
(Fuser_login_name): Support float arguments. Doc fix.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/editfns.c?cvsroot=emacs&r1=1.465&r2=1.466
Patches:
Index: editfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/editfns.c,v
retrieving revision 1.465
retrieving revision 1.466
diff -u -b -r1.465 -r1.466
--- editfns.c 8 Jan 2009 03:15:34 -0000 1.465
+++ editfns.c 18 Mar 2009 20:37:06 -0000 1.466
@@ -1278,12 +1278,13 @@
Also, if the environment variables LOGNAME or USER are set,
that determines the value of this function.
-If optional argument UID is an integer, return the login name of the user
-with that uid, or nil if there is no such user. */)
+If optional argument UID is an integer or a float, return the login name
+of the user with that uid, or nil if there is no such user. */)
(uid)
Lisp_Object uid;
{
struct passwd *pw;
+ uid_t id;
/* Set up the user name info if we didn't do it before.
(That can happen if Emacs is dumpable
@@ -1294,9 +1295,9 @@
if (NILP (uid))
return Vuser_login_name;
- CHECK_NUMBER (uid);
+ id = (uid_t)XFLOATINT (uid);
BLOCK_INPUT;
- pw = (struct passwd *) getpwuid (XINT (uid));
+ pw = (struct passwd *) getpwuid (id);
UNBLOCK_INPUT;
return (pw ? build_string (pw->pw_name) : Qnil);
}
- [Emacs-diffs] emacs/src editfns.c,
Eli Zaretskii <=