From 6364520eb4c795e85f7893ba02de860d132c1d2c Mon Sep 17 00:00:00 2001 From: Terry Dawson VK2KTJ Date: Sat, 22 Sep 2001 12:39:16 +0000 Subject: Fixed ax25ipd conf file bug, small cosmetic changes --- ax25ipd/Makefile.am | 4 ++-- ax25ipd/Makefile.in | 4 ++-- ax25ipd/ax25ipd.c | 7 +++---- ax25ipd/config.c | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'ax25ipd') diff --git a/ax25ipd/Makefile.am b/ax25ipd/Makefile.am index 2c1acd6..da5ba61 100644 --- a/ax25ipd/Makefile.am +++ b/ax25ipd/Makefile.am @@ -30,8 +30,8 @@ installconf: $(INSTALL_DATA) $$p $(DESTDIR)$(AX25_SYSCONFDIR)/$$p; \ done -AX25_SYSCONFDIR=$(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR=$(localstatedir)/ax25/ +AX25_SYSCONFDIR=$(sysconfdir)/ax25 +AX25_LOCALSTATEDIR=$(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25ipd/Makefile.in b/ax25ipd/Makefile.in index d2c6d30..9170cb9 100644 --- a/ax25ipd/Makefile.in +++ b/ax25ipd/Makefile.in @@ -95,8 +95,8 @@ ax25ipd_SOURCES = config.c crc.c io.c kiss.c ax25ipd.c ax25ipd.h proc # Needed so that install is optional etcfiles = ax25ipd.conf -AX25_SYSCONFDIR = $(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR = $(localstatedir)/ax25/ +AX25_SYSCONFDIR = $(sysconfdir)/ax25 +AX25_LOCALSTATEDIR = $(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c index 9c6dea1..b75843e 100644 --- a/ax25ipd/ax25ipd.c +++ b/ax25ipd/ax25ipd.c @@ -55,8 +55,7 @@ int main(int argc, char **argv) int option_index = 0; int c; - c = getopt_long(argc, argv, "c:hl:v", options, - &option_index); + c = getopt_long(argc, argv, "c:hl:v", options, &option_index); if (c == -1) break; @@ -65,15 +64,15 @@ int main(int argc, char **argv) break; switch (option_index) { case 0: - case 2: break; case 1: opt_loglevel = atoi(optarg); break; + case 2: + break; case 3: strncpy(opt_configfile, optarg, 1023); break; - } break; case 'c': diff --git a/ax25ipd/config.c b/ax25ipd/config.c index b80d113..063ca37 100644 --- a/ax25ipd/config.c +++ b/ax25ipd/config.c @@ -76,10 +76,10 @@ char *f; int errflag, e, lineno; char *fname; - if (f) - fname = f; + if (f==NULL || strlen(f) == 0) + fname=CONF_AX25IPD_FILE; else - fname = CONF_AX25IPD_FILE; + fname=f; if ((cf = fopen(fname, "r")) == NULL) { fprintf(stderr, -- cgit v1.2.3