Skip to content

Commit

Permalink
misc_init: remove variable user_name (cmus#898)
Browse files Browse the repository at this point in the history
The variable wasn't used anywhere in cmus. Having it made cmus
unnecessarily required env var USER or USERNAME to work.
  • Loading branch information
tomty89 authored and flyingmutant committed Apr 16, 2019
1 parent e429ddf commit 2748d40
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
8 changes: 0 additions & 8 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const char *cmus_socket_path = NULL;
const char *cmus_data_dir = NULL;
const char *cmus_lib_dir = NULL;
const char *home_dir = NULL;
const char *user_name = NULL;

char **get_words(const char *text)
{
Expand Down Expand Up @@ -220,13 +219,6 @@ int misc_init(void)
if (home_dir == NULL)
die("error: environment variable HOME not set\n");

user_name = get_non_empty_env("USER");
if (user_name == NULL) {
user_name = get_non_empty_env("USERNAME");
if (user_name == NULL)
die("error: neither USER or USERNAME environment variable set\n");
}

cmus_config_dir = get_non_empty_env("CMUS_HOME");
if (cmus_config_dir == NULL) {
char *cmus_home = xstrjoin(home_dir, "/.cmus");
Expand Down
1 change: 0 additions & 1 deletion misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern const char *cmus_socket_path;
extern const char *cmus_data_dir;
extern const char *cmus_lib_dir;
extern const char *home_dir;
extern const char *user_name;

char **get_words(const char *text);
int strptrcmp(const void *a, const void *b);
Expand Down

0 comments on commit 2748d40

Please sign in to comment.