diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 5c9c34dc352..6ba09cceec4 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1233,7 +1233,11 @@ return "unknown". | |||
| 1233 | If optional argument UID is an integer, return the full name | 1233 | If optional argument UID is an integer, return the full name |
| 1234 | of the user with that uid, or nil if there is no such user. | 1234 | of the user with that uid, or nil if there is no such user. |
| 1235 | If UID is a string, return the full name of the user with that login | 1235 | If UID is a string, return the full name of the user with that login |
| 1236 | name, or nil if there is no such user. */) | 1236 | name, or nil if there is no such user. |
| 1237 | |||
| 1238 | If the full name includes commas, remove everything starting with | ||
| 1239 | the first comma, because the \\='gecos\\=' field of the \\='/etc/passwd\\=' file | ||
| 1240 | is in general a comma-separated list. */) | ||
| 1237 | (Lisp_Object uid) | 1241 | (Lisp_Object uid) |
| 1238 | { | 1242 | { |
| 1239 | struct passwd *pw; | 1243 | struct passwd *pw; |
| @@ -1263,7 +1267,8 @@ name, or nil if there is no such user. */) | |||
| 1263 | return Qnil; | 1267 | return Qnil; |
| 1264 | 1268 | ||
| 1265 | p = USER_FULL_NAME; | 1269 | p = USER_FULL_NAME; |
| 1266 | /* Chop off everything after the first comma. */ | 1270 | /* Chop off everything after the first comma, since 'pw_gecos' is a |
| 1271 | comma-separated list. */ | ||
| 1267 | q = strchr (p, ','); | 1272 | q = strchr (p, ','); |
| 1268 | full = make_string (p, q ? q - p : strlen (p)); | 1273 | full = make_string (p, q ? q - p : strlen (p)); |
| 1269 | 1274 | ||