From 59fdf30f9270823808555ba22630aff50781a00b Mon Sep 17 00:00:00 2001 From: Brooks Davis 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 590dbf66f00..632cc6ae308 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); -- 2.45.2