diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-04-09 17:03:43 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-09 17:05:44 -0700 |
commit | 7a238b614685ce7d85b1a7564871e72c960bad89 (patch) | |
tree | c26660bce37d2912df3533a13ace7d1e9589789b /core/unix.c | |
parent | 67a717dc057a5936ae1f5820fc6c470524213b97 (diff) | |
download | subsurface-7a238b614685ce7d85b1a7564871e72c960bad89.tar.gz |
cloud-storage: simplify creation of git authorship
While having the local user information in the repo on Linux seemed
clever when we implemented it, it's inconsistent with all the other
platforms. Let's just not do that unless the user has indeed set
a global name/email pair for git.
Instead indicate if this was Subsurface or Subsurface-mobile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/unix.c')
-rw-r--r-- | core/unix.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/core/unix.c b/core/unix.c index 5106278a2..bcac33ff3 100644 --- a/core/unix.c +++ b/core/unix.c @@ -34,36 +34,6 @@ bool subsurface_ignore_font(const char *font) return false; } -void subsurface_user_info(struct user_info *user) -{ - struct passwd *pwd = getpwuid(getuid()); - const char *username = getenv("USER"); - - if (pwd) { - if (!empty_string(pwd->pw_gecos)) { - user->name = strdup(pwd->pw_gecos); - // We only want the name, not the office or phone number - char *c = user->name; - while (*c) { - if (*c == ',') { - *c = '\0'; - break; - } - ++c; - } - } - if (!username) - username = pwd->pw_name; - } - if (!empty_string(username)) { - char hostname[64]; - struct membuffer mb = {}; - gethostname(hostname, sizeof(hostname)); - put_format(&mb, "%s@%s", username, hostname); - user->email = detach_cstring(&mb); - } -} - static const char *system_default_path_append(const char *append) { const char *home = getenv("HOME"); |