From 626003d7272828ee3551b129c2815f2acff54be3 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 5 Oct 2004 22:16:31 +0000 Subject: [PATCH] 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(-) diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index 590dbf66f00f..632cc6ae308e 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);