]> git.lyx.org Git - lyx.git/blobdiff - src/support/userinfo.cpp
Update my email and status.
[lyx.git] / src / support / userinfo.cpp
index df8a3ac83ff1f3defc4b6aa0e6c04939a8d83871..c873afe24744d9c5616348f97e34662c77869ce3 100644 (file)
@@ -14,7 +14,7 @@
 #include "support/environment.h"
 #include "support/docstring.h"
 
-#include "support/assert.h"
+#include "support/lassert.h"
 
 #if defined (_WIN32)
 # include "support/gettext.h"
@@ -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);