From 626003d7272828ee3551b129c2815f2acff54be3 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 5 Oct 2004 22:16:31 +0000 Subject: Don't prepend the directory specified by -d when the file is a relative path. Doing so makes no sense. I'm not sure allowing relative paths makes sense either, but I'm not going to break that now. --- usr.sbin/newsyslog/newsyslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/newsyslog/newsyslog.c') diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index 590dbf6..632cc6a 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -340,7 +340,7 @@ init_entry(const char *fname, struct conf_entry *src_entry) if (tempwork == NULL) err(1, "malloc of conf_entry for %s", fname); - if (destdir == NULL) + if (destdir == NULL || fname[0] != '/') tempwork->log = strdup(fname); else asprintf(&tempwork->log, "%s%s", destdir, fname); -- cgit v1.1