]> git.lyx.org Git - lyx.git/blobdiff - src/support/userinfo.cpp
Remove unneeded mutable keywords
[lyx.git] / src / support / userinfo.cpp
index ca4e0e948077be62c8dba20631e24ac14dc682b1..af33d1d66a11f40464f4a326211e642def27eacb 100644 (file)
@@ -14,7 +14,7 @@
 #include "support/environment.h"
 #include "support/docstring.h"
 
-#include <boost/assert.hpp>
+#include "support/lassert.h"
 
 #if defined (_WIN32)
 # include "support/gettext.h"
@@ -46,9 +46,11 @@ docstring const user_name()
        return from_local8bit(name);
 #else
        struct passwd * pw = getpwuid(geteuid());
-       BOOST_ASSERT(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);