diff --git a/ncal.1 b/ncal.1 index 3871c49..ad03ee8 100644 --- a/ncal.1 +++ b/ncal.1 @@ -96,8 +96,6 @@ the current month is displayed. .Pp The options are as follows: .Bl -tag -width indent -.It Fl h -Turns off highlighting of today. .It Fl J Display Julian Calendar, if combined with the .Fl o diff --git a/ncal.c b/ncal.c index 8ecbb33..6d394b4 100644 --- a/ncal.c +++ b/ncal.c @@ -161,7 +161,6 @@ static char jdaystr[] = " 1 2 3 4 5 6 7 8 9" " 350 351 352 353 354 355 356 357 358 359" " 360 361 362 363 364 365 366"; -static int flag_nohighlight; /* user doesn't want a highlighted today */ static int flag_weeks; /* user wants number of week */ static int nswitch; /* user defined switch date */ static int nswitchb; /* switch date for backward compatibility */ @@ -221,7 +220,6 @@ main(int argc, char *argv[]) int before, after; const char *locale; /* locale to get country code */ - flag_nohighlight = 0; flag_weeks = 0; /* @@ -311,13 +309,6 @@ main(int argc, char *argv[]) no_backward = 1; flag_highlightdate = optarg; break; - case 'h': - if (flag_backward) - usage(); - else - no_backward = 1; - flag_nohighlight = 1; - break; case 'e': if (flag_backward) usage(); @@ -922,7 +913,7 @@ 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 && isatty(STDOUT_FILENO)) highlight(mlines->lines[i] + k, ds + dt.d * dw, dw, &l); @@ -1033,7 +1024,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) dt.d = j - jan1 + 1; else sdateb(j, &dt); - if (j == highlightdate && !flag_nohighlight) + if (j == highlightdate) highlight(mlines->lines[i] + k + l, ds + dt.d * dw, dw, &l); else @@ -1239,15 +1230,6 @@ highlight(char *dst, char *src, int len, int *extralen) first = 0; } - /* - * This check is not necessary, should have been handled before calling - * this function. - */ - if (flag_nohighlight) { - memcpy(dst, src, len); - return; - } - /* * If it is a real terminal, use the data from the termcap database. */