mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Accept empty -T arguments.
Proposed by: clemens fischer <ino-qc@spotteswoode.de.eu.org>
This commit is contained in:
parent
753eda06f3
commit
8d2888bc54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177795
@ -16,6 +16,8 @@ test: ${PROG}
|
||||
./${PROG} -t /tmp/fifolog.0
|
||||
./${PROG} /tmp/fifolog.1
|
||||
./${PROG} -B "00:00" /tmp/fifolog.1
|
||||
./${PROG} -T "%y%m%d-%H%M%S" /tmp/fifolog.1
|
||||
./${PROG} -T "" /tmp/fifolog.1
|
||||
|
||||
t2:
|
||||
./${PROG} -t /critter/10.1.29.74.fifolog
|
||||
|
@ -59,7 +59,9 @@ Render(void *priv __unused, time_t now, unsigned flag __unused, const unsigned c
|
||||
if (opt_R != NULL && regexec(&R, (const char *)p, 0, NULL, 0))
|
||||
return;
|
||||
|
||||
if (opt_T != NULL) {
|
||||
if (opt_T != NULL && *opt_T == '\0') {
|
||||
fprintf(fo, "%s\n", p);
|
||||
} else if (opt_T != NULL) {
|
||||
(void)gmtime_r(&now, &utc);
|
||||
i = strftime(buf, sizeof buf, opt_T, &utc);
|
||||
assert(i > 0);
|
||||
|
Loading…
Reference in New Issue
Block a user