diff options
author | edwin <edwin@FreeBSD.org> | 2011-07-11 10:41:08 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2011-07-11 10:41:08 +0000 |
commit | c1425b09de24ceec80e04efcaa68419c578438f5 (patch) | |
tree | 7c6b534702a37555c1c8c3da757992f3a53f2b76 /usr.bin/ncal/ncal.c | |
parent | ee2ff3b6134ec7a822a85f545859d65ab4a5509f (diff) | |
download | FreeBSD-src-c1425b09de24ceec80e04efcaa68419c578438f5.zip FreeBSD-src-c1425b09de24ceec80e04efcaa68419c578438f5.tar.gz |
ncal(1) highlights the current date (or a date provided via parameter)
even if stdout is not a tty. If stdout is not a tty the data is
normally processed by other tools and no control sequences are
expected.
PR: bin/158580
MFC after: 1 week
Diffstat (limited to 'usr.bin/ncal/ncal.c')
-rw-r--r-- | usr.bin/ncal/ncal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 44e31fe..2ca770a 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -822,7 +822,8 @@ mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines) dt.d = j - jan1 + 1; else sdater(j, &dt); - if (j == highlightdate && !flag_nohighlight) + if (j == highlightdate && !flag_nohighlight + && isatty(STDOUT_FILENO)) highlight(mlines->lines[i] + k, ds + dt.d * dw, dw, &l); else |