summaryrefslogtreecommitdiffstats
path: root/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch b/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
new file mode 100644
index 0000000..073506e
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
@@ -0,0 +1,37 @@
+If you try to use cal on a terminal which doesnt support highlighting,
+Senter and Sexit will be set to NULL instead of "" which will cause the
+resulting output to be off:
+
+$ env TERM=dumb cal
+ December 2005
+Su Mo Tu We Th Fr Sa
+ 1 2 3
+ 4 5 6 7 8 9 10
+111 13 14 15 16 17
+18 19 20 21 22 23 24
+25 26 27 28 29 30 31
+
+http://bugs.gentoo.org/112406
+
+--- util-linux/misc-utils/cal.c
++++ util-linux/misc-utils/cal.c
+@@ -89,7 +89,8 @@
+
+ static char *
+ my_tgetstr(char *s, char *ss) {
+- return tigetstr(ss);
++ char *ret = tigetstr(ss);
++ return (ret == NULL ? "" : ret);
+ }
+
+ #elif defined(HAVE_termcap)
+@@ -112,7 +113,8 @@
+
+ static char *
+ my_tgetstr(char *s, char *ss) {
+- return tgetstr(s, &strbuf);
++ char *ret = tgetstr(s, &strbuf);
++ return (ret == NULL ? "" : ret);
+ }
+
+ #endif