Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112406 - util-linux/cal.c displays wrong with dumb TERMinals
Summary: util-linux/cal.c displays wrong with dumb TERMinals
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-13 05:51 UTC by Chris Smith
Modified: 2005-12-12 19:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2005-11-13 05:51:26 UTC
On Sunday Nov 13, the calendar produced by cal fails starting on Nov 13.

foxboro$ /usr/bin/cal
   November 2005    
Su Mo Tu We Th Fr Sa
       1  2  3  4  5
 6  7  8  9 10 11 12
 14 15 16 17 18 19
`^O


foxboro$ date
Sun Nov 13 06:48:10 MST 2005
foxboro$

The ^O is a control-O.


Reproducible: Always
Steps to Reproduce:
1. Set date to Nov 13 (don't know if this is necessary)
2. /usr/bin/cal
3.

Actual Results:  
See above

Expected Results:  
cal 2005 produces a good November


Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2,
2.6.11.11-w4l i686)
=================================================================
System uname: 2.6.11.11-w4l i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon-xp"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -march=athlon-xp"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.mirrors.tds.net/gentoo
http://open-systems.ufl.edu/mirrors/gentoo http://distfiles.gentoo.org"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt
cups dvdr eds emacs emboss encode expat fbcon foomaticdb fortran gdbm gif gpm
gstreamer gtk gtk2 imlib jpeg lcms libg++ libwww mad maildir mikmod mng motif
mp3 mpeg ncurses nls nsplugin ogg oggvorbis opengl oss pam pcre pdflib perl png
python qt quicktime readline sdl spell ssl tcpd tetex tiff truetype
truetype-fonts type1-fonts udev vorbis xml2 xmms xv zlib userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-11-13 05:57:22 UTC
Which ebuild is this about? Works fine with util-linux-2.12r here.
Comment 2 Chris Smith 2005-11-13 21:43:18 UTC
Yes, util-linux-2.12r.

I was in an emacs shell buffer.  It works for me in an xterm.  Try

  TERM=dumb cal
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-11-14 06:24:44 UTC
(In reply to comment #2)
> I was in an emacs shell buffer.  It works for me in an xterm.  Try

>   TERM=dumb cal

Works just fine. Not reproducible here, assigning to emacs.
Comment 4 Matthew Kennedy (RETIRED) gentoo-dev 2005-12-10 13:05:58 UTC
I can't reproduce this with "cal 11 2005".  Are you using any fancy
PROMPT_COMMAND, PS1 etc. also, try it in an Emacs started like this "emacs -q" --
if it persists, then you can rule out your own .emacs.
Comment 5 Chris Smith 2005-12-10 15:30:15 UTC
(In reply to comment #4)

I don't see how this is emacs related, given that it happens for me in an xterm
window as well.  cal 11 2005 will not be interesting, I think the bug is related
to trying to highlight the current day.  Today I get

 
foxboro$ /usr/bin/cal
   December 2005    
Su Mo Tu We Th Fr Sa
             1  2  3
 4  5  6  7  8  91
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

on dec 10.  In an xterm window TERM=dumb is required.  The output is the same.
emacs -q then m-x shell is the same.  No fancy PS1 etc, here is my environment:

NNTPSERVER=newsgroups.comcast.net
MANPATH=/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man::/opt/sun-jdk-1.4.2.09/man:/usr/qt/3/doc/man
HOSTNAME=foxboro
SHELL=/bin/bash
TERM=dumb
HISTSIZE=5000
CVSROOT=/opt/cvs
QTDIR=/usr/qt/3
HISTFILESIZE=5000
NAME=Chris Smith
USER=csmith
EMACS=t
PRELINK_PATH_MASK=/usr/lib/gstreamer-0.8
GDK_USE_XFT=1
TERMCAP=
XPID=7132
PYTHONDOCS=/usr/share/doc/python-docs-2.4.2/html
PAGER=evenless
CONFIG_PROTECT_MASK=/etc/terminfo
COLUMNS=80
XINITRC=/home/csmith/.xinitrc
MAIL=/var/mail/csmith
PATH=/home/csmith/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.6:/opt/sun-jdk-1.4.2.09/bin:/opt/sun-jdk-1.4.2.09/jre/bin:/opt/sun-jdk-1.4.2.09/jre/javaws:/usr/qt/3/bin:/usr/kde/3.4/bin:/bin:/usr/bin:/sbin:/usr/sbin
DISTCC_LOG=
PWD=/home/csmith
JAVA_HOME=/opt/sun-jdk-1.4.2.09
EDITOR=emacsclient
JAVAC=/opt/sun-jdk-1.4.2.09/bin/javac
QMAKESPEC=linux-g++
KDEDIRS=/usr
PS1=foxboro\$ 
DISTCC_VERBOSE=0
DCCC_PATH=/usr/lib/distcc/bin
TEXINPUTS=.:/home/csmith/tex:
JDK_HOME=/opt/sun-jdk-1.4.2.09
SHLVL=3
HOME=/home/csmith
LESS=-R
PYTHONPATH=/usr/lib/portage/pym
LOGNAME=csmith
CVS_RSH=ssh
GCC_SPECS=
ROOTPATH=/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.6:/opt/sun-jdk-1.4.2.09/bin:/opt/sun-jdk-1.4.2.09/jre/bin:/opt/sun-jdk-1.4.2.09/jre/javaws:/usr/qt/3/bin:/usr/kde/3.4/sbin:/usr/kde/3.4/bin
CLASSPATH=.
LESSOPEN=|lesspipe.sh %s
INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info:/usr/share/info/emacs-21
DISPLAY=:0
OPENGL_PROFILE=xorg-x11
G_BROKEN_FILENAMES=1
CONFIG_PROTECT=/var/bind /usr/lib/X11/xkb /usr/kde/3.4/share/config
/usr/kde/3.4/env /usr/kde/3.4/shutdown /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/xdvi/ /usr/share/config
_=/bin/printenv
OLDPWD=/home/csmith



Comment 6 Matthew Kennedy (RETIRED) gentoo-dev 2005-12-11 12:33:13 UTC
I see what you mean now.  Punting this bug back to bug-wranglers.  Someone 
maintaining sys-apps/util-linux should take a look at how cal tries to highlight
the current day.  It looks like its trying to do so without checking terminal
capabilities, or at least making a bad choice in the case of TERM=dumb.
Comment 7 SpanKY gentoo-dev 2005-12-11 17:37:04 UTC
what does this have to do with busybox or coreutils ?
Comment 8 Chris Smith 2005-12-11 22:56:45 UTC
(In reply to comment #7)
> what does this have to do with busybox or coreutils ?

Nothing, the title line is screwed up, it says busybox because that was the only
cal.c I could find when I went looking.
Comment 9 SpanKY gentoo-dev 2005-12-12 06:28:11 UTC
well, setting TERM=dumb in an xterm window just dumb anyways :p
Comment 10 SpanKY gentoo-dev 2005-12-12 19:03:09 UTC
ok, found the issue and fixed it with 2.12-r2