Skip to content

Commit

Permalink
Fix discarted qualifiers warning
Browse files Browse the repository at this point in the history
Signed-off-by: anna <[email protected]>
  • Loading branch information
navi-desu committed Jan 20, 2023
1 parent ef2ce86 commit 8e81d83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ rc_sys(void)
char *
rc_sysconfdir_get(void) {
static char path[PATH_MAX] = { 0 };
if (geteuid() != 0) {
if (!*path) {
if (!*path) {
if (geteuid() != 0) {
char *config_path;
if ((config_path = getenv("XDG_CONFIG_HOME"))) {
snprintf(path, PATH_MAX, "%s", config_path);
Expand All @@ -363,18 +363,18 @@ rc_sysconfdir_get(void) {
} else {
exit(1);
}
} else {
snprintf(path, PATH_MAX, "%s", RC_SYSCONFDIR);
}
return path;
} else {
return RC_SYSCONFDIR;
}
return path;
}

char *
rc_svcdir_get(void) {
static char path[PATH_MAX] = { 0 };
if (geteuid() != 0) {
if (!*path) {
if (!*path) {
if (geteuid() != 0) {
char *config_path;
if ((config_path = getenv("XDG_RUNTIME_DIR")) ||
(config_path = getenv("XDG_DATA_HOME"))) {
Expand All @@ -385,11 +385,11 @@ rc_svcdir_get(void) {
} else {
exit(1);
}
} else {
snprintf(path, PATH_MAX, "%s", RC_SVCDIR);
}
return path;
} else {
return RC_SVCDIR;
}
return path;
}

char *
Expand Down

0 comments on commit 8e81d83

Please sign in to comment.