Quote SYSCONFDIR definition

As SYSCONFDIR is a compile time string literal, use compile time string
concatenation instead of a runtime one.

Also drop related TODO, cause we indeed using the correct way of getting
$sysconfdir from autoconf
This commit is contained in:
Christian Göttsche 2021-01-29 16:44:23 +01:00 committed by cgzones
parent 06b1674aa6
commit 8bd543562b
2 changed files with 2 additions and 5 deletions

View File

@ -18,7 +18,7 @@ pixmap_DATA = htop.png
appicondir = $(datadir)/icons/hicolor/scalable/apps appicondir = $(datadir)/icons/hicolor/scalable/apps
appicon_DATA = htop.svg appicon_DATA = htop.svg
AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)" AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR="\"$(sysconfdir)\"" -I"$(top_srcdir)/$(my_htop_platform)"
AM_LDFLAGS = AM_LDFLAGS =
myhtopsources = \ myhtopsources = \

View File

@ -424,10 +424,7 @@ Settings* Settings_new(int initialCpuCount) {
} }
if (!ok) { if (!ok) {
this->changed = true; this->changed = true;
// TODO: how to get SYSCONFDIR correctly through Autoconf? ok = Settings_read(this, SYSCONFDIR "/htoprc", initialCpuCount);
char* systemSettings = String_cat(SYSCONFDIR, "/htoprc");
ok = Settings_read(this, systemSettings, initialCpuCount);
free(systemSettings);
} }
if (!ok) { if (!ok) {
Settings_defaultMeters(this, initialCpuCount); Settings_defaultMeters(this, initialCpuCount);