# HG changeset patch # User Eli Zaretskii # Date 1237408626 0 # Node ID f13c449487adc17e32c12e43b171e2e3ec56bff9 # Parent d9ae831ced99e0e272dc0206d2f065d699e326e7 (Fuser_login_name): Support float arguments. Doc fix. diff -r d9ae831ced99 -r f13c449487ad src/editfns.c --- a/src/editfns.c Wed Mar 18 09:14:56 2009 +0000 +++ b/src/editfns.c Wed Mar 18 20:37:06 2009 +0000 @@ -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); }