mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 20:09:59 +00:00
Strip gecos on Unix systems on user name only.
Patch from Scott Kostyshak.
This commit is contained in:
parent
9541e6b851
commit
4ce24954aa
@ -48,7 +48,9 @@ docstring const user_name()
|
||||
struct passwd * pw = getpwuid(geteuid());
|
||||
LASSERT(pw, /**/);
|
||||
|
||||
string name = pw->pw_gecos;
|
||||
const string gecos = pw->pw_gecos;
|
||||
const size_t pos = gecos.find(",");
|
||||
string name = gecos.substr(0, pos);
|
||||
if (name.empty())
|
||||
name = pw->pw_name;
|
||||
return from_local8bit(name);
|
||||
|
@ -18,7 +18,7 @@
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
|
||||
/// return the current user's real name
|
||||
/// return the current user's real name or user name
|
||||
docstring const user_name();
|
||||
|
||||
/// return the current user's e-mail address
|
||||
|
Loading…
x
Reference in New Issue
Block a user