From: markus schnalke Date: Thu, 22 Mar 2012 06:40:35 +0000 (+0100) Subject: slocal: use mhetcdir instead of NMHETCDIR. X-Git-Tag: mmh-thesis-end~263 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=cde17f8d38bf9306df4706ac2acb528a2a686a29;p=mmh slocal: use mhetcdir instead of NMHETCDIR. --- diff --git a/uip/Makefile.in b/uip/Makefile.in index bd114ce..d81985f 100644 --- a/uip/Makefile.in +++ b/uip/Makefile.in @@ -17,7 +17,6 @@ etcdir = @sysconfdir@ CC = @CC@ CFLAGS = @CFLAGS@ DEFS = @DEFS@ -CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir) @CPPFLAGS@ LDFLAGS = @LDFLAGS@ @@ -32,7 +31,6 @@ TERMLIB = @TERMLIB@ LEXLIB = @LEXLIB@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS) -COMPILE2 = $(CC) -c $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(CFLAGS) LINK = $(CC) $(LDFLAGS) -o $@ LN = ln @@ -215,9 +213,6 @@ sendfiles: sendfiles.sh show: show.o $(LOCALLIBS) $(LINK) show.o $(LINKLIBS) -slocal.o: slocal.c - $(COMPILE2) $(srcdir)/slocal.c - slocal: slocal.o $(LOCALLIBS) $(LINK) slocal.o $(LINKLIBS) diff --git a/uip/slocal.c b/uip/slocal.c index d97af90..eecd760 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -86,10 +86,6 @@ static struct swit switches[] = { }; -/* global maildelivery file */ -char *maildelivery = NMHETCDIR"/maildelivery"; - - static int globbed = 0; /* have we built "vars" table yet? */ static int parsed = 0; /* have we built header field table yet */ static int utmped = 0; /* have we scanned umtp(x) file yet */ @@ -437,12 +433,15 @@ main(int argc, char **argv) static int localmail(int fd, char *mdlvr) { + char buf[BUFSIZ]; + /* delivery according to personal Maildelivery file */ if (usr_delivery(fd, mdlvr ? mdlvr : ".maildelivery", 0) != -1) { return 0; } /* delivery according to global Maildelivery file */ - if (usr_delivery(fd, maildelivery, 1) != -1) { + snprintf(buf, sizeof buf, "%s/%s", mhetcdir, "maildelivery"); + if (usr_delivery(fd, buf, 1) != -1) { return 0; } if (verbose) {