newsyslog - More basename/dirname changes
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 29 Jan 2018 00:38:39 +0000 (01:38 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 29 Jan 2018 00:38:39 +0000 (01:38 +0100)
commitfe742af3e544f46a206a45ce6e68382bee28f653
tree1f77388792887c04c37fb275b27de6bc1d9372ae
parent9a304aedf5e3cba3ab8ae1c47edacd0cf9819e7a
newsyslog - More basename/dirname changes

Properly patch up dirname()/basename() calls to not clobber ent->log.

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Obtained-from: FreeBSD (r305651)
usr.sbin/newsyslog/newsyslog.c