emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 5fccd1e371: Explain why we remove stuff from 'user-full-name'


From: Eli Zaretskii
Subject: emacs-28 5fccd1e371: Explain why we remove stuff from 'user-full-name'
Date: Sat, 25 Dec 2021 02:38:59 -0500 (EST)

branch: emacs-28
commit 5fccd1e371d81688f10c24346b11db6880c6b9be
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Explain why we remove stuff from 'user-full-name'
    
    * src/editfns.c (Fuser_full_name): Document why we chop everything
    starting from the first comma.  (Bug#52785)
---
 src/editfns.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/editfns.c b/src/editfns.c
index 5c9c34dc35..6ba09cceec 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1233,7 +1233,11 @@ return "unknown".
 If optional argument UID is an integer, return the full name
 of the user with that uid, or nil if there is no such user.
 If UID is a string, return the full name of the user with that login
-name, or nil if there is no such user.  */)
+name, or nil if there is no such user.
+
+If the full name includes commas, remove everything starting with
+the first comma, because the \\='gecos\\=' field of the \\='/etc/passwd\\=' 
file
+is in general a comma-separated list.  */)
   (Lisp_Object uid)
 {
   struct passwd *pw;
@@ -1263,7 +1267,8 @@ name, or nil if there is no such user.  */)
     return Qnil;
 
   p = USER_FULL_NAME;
-  /* Chop off everything after the first comma. */
+  /* Chop off everything after the first comma, since 'pw_gecos' is a
+     comma-separated list. */
   q = strchr (p, ',');
   full = make_string (p, q ? q - p : strlen (p));
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]