(Fuser_full_name): Return nil if the specified user doesn't exist.
(init_editfns): Set Vuser_full_name to "unknown" if the user name can't be resolved.
This commit is contained in:
parent
0a26b136cd
commit
3347526ce7
1 changed files with 3 additions and 1 deletions
|
@ -109,6 +109,8 @@ init_editfns ()
|
||||||
p = (unsigned char *) getenv ("NAME");
|
p = (unsigned char *) getenv ("NAME");
|
||||||
if (p)
|
if (p)
|
||||||
Vuser_full_name = build_string (p);
|
Vuser_full_name = build_string (p);
|
||||||
|
else if (NILP (Vuser_full_name))
|
||||||
|
Vuser_full_name = build_string ("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
|
DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
|
||||||
|
@ -585,7 +587,7 @@ name, or \"unknown\" if no such user could be found.")
|
||||||
error ("Invalid UID specification");
|
error ("Invalid UID specification");
|
||||||
|
|
||||||
if (!pw)
|
if (!pw)
|
||||||
return build_string ("unknown");
|
return Qnil;
|
||||||
|
|
||||||
p = (unsigned char *) USER_FULL_NAME;
|
p = (unsigned char *) USER_FULL_NAME;
|
||||||
/* Chop off everything after the first comma. */
|
/* Chop off everything after the first comma. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue