X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fuserinfo.cpp;h=97c458c7c710882403686494f990a99112611960;hb=83b1ac3b55ada8d9198b611e8a52ac5d02111e8b;hp=5f2cfcab65599d954b565d8df803d0ab4c93a2ef;hpb=9b4a26a252b2da164fcd6aa84feed0a738b16c10;p=lyx.git diff --git a/src/support/userinfo.cpp b/src/support/userinfo.cpp index 5f2cfcab65..97c458c7c7 100644 --- a/src/support/userinfo.cpp +++ b/src/support/userinfo.cpp @@ -46,9 +46,11 @@ docstring const user_name() return from_local8bit(name); #else struct passwd * pw = getpwuid(geteuid()); - LASSERT(pw, /**/); + LASSERT(pw, return docstring()); - 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); @@ -62,11 +64,12 @@ docstring const user_email() //The code after should be used only after user approval. return docstring(); - +#if 0 string email = getEnv("EMAIL_ADDRESS"); if (email.empty()) email = getEnv("EMAIL"); return from_local8bit(email); +#endif } } // namespace support