Package: bsdmainutils
Version: 9.0.6
Severity: normal

In the debian stable version of bsdmainutils, (9.0.6), one can use `ncal -C -h`
and `ncal -C -H 2017-01-01`. When I rebuild ncal from git
(b878431ef60d2895d94e9786f3cd091ae6d55e1c 9.0.12, with ncal_options.diff) this
combination is not supported anymore:

```
(stable version from /usr)
pseyfert@robusta ~/coding/bsdmainutils/usr.bin/ncal > LC_ALL=C \ncal -C -3 -h
   December 2016          January 2017         February 2017
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
             1  2  3   1  2  3  4  5  6  7            1  2  3  4
 4  5  6  7  8  9 10   8  9 10 11 12 13 14   5  6  7  8  9 10 11
11 12 13 14 15 16 17  15 16 17 18 19 20 21  12 13 14 15 16 17 18
18 19 20 21 22 23 24  22 23 24 25 26 27 28  19 20 21 22 23 24 25
25 26 27 28 29 30 31  29 30 31              26 27 28
```

```
(fresh built from git)
pseyfert@robusta ~/coding/bsdmainutils/usr.bin/ncal > LC_ALL=C ./ncal -C -3 -h
Usage: cal [general options] [-jy] [[month] year]
       cal [general options] [-j] [-m month] [year]
       ncal -C [general options] [-jy] [[month] year]
       ncal -C [general options] [-j] [-m month] [year]
       ncal [general options] [-bhJjpwySM] [-H yyyy-mm-dd] [-s country_code]
[[month] year]
       ncal [general options] [-bhJeoSM] [year]
General options: [-31] [-A months] [-B months] [-d yyyy-mm]
```

with this patch on top I restore what seems to me about desirable:
```
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c
index 418b77f..c4ce848 100644
--- a/usr.bin/ncal/ncal.c
+++ b/usr.bin/ncal/ncal.c
@@ -161,6 +161,7 @@ char jdaystr[] = "       1   2   3   4   5   6   7   8   9"
                 " 360 361 362 363 364 365 366";

 int    flag_nohighlight;       /* user doesn't want a highlighted today */
+int    flag_highlight; /* user wants a highlighted day */
 int     flag_weeks;            /* user wants number of week */
 int     nswitch;               /* user defined switch date */
 int    nswitchb;               /* switch date for backward compatibility */
@@ -217,6 +218,7 @@ main(int argc, char *argv[])
        const char    *locale;          /* locale to get country code */

        flag_nohighlight = 0;
+       flag_highlight = 0;
        flag_weeks = 0;

        /*
@@ -300,17 +302,15 @@ main(int argc, char *argv[])
                        flag_today = optarg;
                        break;
                case 'H':
-                       if (flag_backward)
+                       if (flag_nohighlight)
                                usage();
                        else
-                               no_backward = 1;
+                               flag_highlight = 1;
                        flag_highlightdate = optarg;
                        break;
                case 'h':
-                       if (flag_backward)
+                       if (flag_highlight)
                                usage();
-                       else
-                               no_backward = 1;
                        flag_nohighlight = 1;
                        break;
                case 'e':
```



-- System Information:
Debian Release: 8.6
  APT prefers stable
  APT policy: (900, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to de_DE.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bsdmainutils depends on:
ii  bsdutils     1:2.25.2-6
ii  debianutils  4.4+b1
ii  libc6        2.19-18+deb8u6
ii  libncurses5  5.9+20140913-1+b1
ii  libtinfo5    5.9+20140913-1+b1

bsdmainutils recommends no packages.

Versions of packages bsdmainutils suggests:
ii  cpp                   4:4.9.2-2
pn  vacation              <none>
ii  wamerican [wordlist]  7.1-1
ii  whois                 5.2.7
ii  wngerman [wordlist]   20131206-5

-- no debconf information

Reply via email to