]> git.lyx.org Git - lyx.git/blobdiff - src/support/userinfo.cpp
Update my email and status.
[lyx.git] / src / support / userinfo.cpp
index da86eb3355b96861dadaf0649ac8ef42197f983d..c873afe24744d9c5616348f97e34662c77869ce3 100644 (file)
 #include "support/environment.h"
 #include "support/docstring.h"
 
-#include <boost/assert.hpp>
+#include "support/lassert.h"
 
 #if defined (_WIN32)
-# include "gettext.h"
+# include "support/gettext.h"
 # include <windows.h>
 # include <lmcons.h>
 #else
@@ -30,7 +30,7 @@
 # include <sys/types.h>
 #endif
 
-using std::string;
+using namespace std;
 
 namespace lyx {
 namespace support {
@@ -46,9 +46,11 @@ docstring const user_name()
        return from_local8bit(name);
 #else
        struct passwd * pw = getpwuid(geteuid());
-       BOOST_ASSERT(pw);
+       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);