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.
This commit is contained in:
brooks 2004-10-05 22:16:31 +00:00
parent d5dfe59f9e
commit 626003d727

View File

@ -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);