diff --git a/stikkit/configuration.cpp b/stikkit/configuration.cpp index 679e43e..eebbf5a 100644 --- a/stikkit/configuration.cpp +++ b/stikkit/configuration.cpp @@ -24,7 +24,7 @@ string Configuration::URL = ""; string Configuration::Expiry = "60"; bool Configuration::Private = false; string Configuration::Author = ""; -string Configuration::Version = "1.0.2"; +string Configuration::Version = "1.0.3"; string Configuration::Title = ""; string Configuration::Home = ""; string Configuration::DefaultURL = ""; @@ -60,6 +60,11 @@ void Configuration::Init() } f.close(); } + if (Configuration::Author.length() < 1) + { + // we don't have any author here! let's get it from passwd + Configuration::Author = pw->pw_name; + } } void Configuration::Store() diff --git a/stikkit/main.cpp b/stikkit/main.cpp index cba7de0..1382e76 100644 --- a/stikkit/main.cpp +++ b/stikkit/main.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include "configuration.hpp" #include "terminalparser.hpp" @@ -37,15 +36,8 @@ int main(int argc, char *argv[]) delete t; if (!Stikkit::Configuration::Author.length()) { - char buffer[200]; - if (getlogin_r(buffer, 200)) - { - Stikkit::Configuration::Author = buffer; - } else - { - // we need to provide some author name otherwise stikked will not display anything or some random characters there - Stikkit::Configuration::Author = "Unknown"; - } + // we need to provide some author name otherwise stikked will not display anything or some random characters there + Stikkit::Configuration::Author = "Unknown"; } if (!Stikkit::Configuration::URL.length()) {