Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 313558 Details for
Bug 458055
"cal -3" generates improperly formatted output
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch based on upstream code
util-linux-2.13-cal-3.patch (text/plain), 3.12 KB, created by
ritz
on 2008-08-06 12:32:22 UTC
(
hide
)
Description:
patch based on upstream code
Filename:
MIME Type:
Creator:
ritz
Created:
2008-08-06 12:32:22 UTC
Size:
3.12 KB
patch
obsolete
>--- util-linux-2.13-pre7/misc-utils/cal.c.kzak 2007-07-09 14:54:39.000000000 +0200 >+++ util-linux-2.13-pre7/misc-utils/cal.c 2007-07-09 14:54:39.000000000 +0200 >@@ -87,9 +87,13 @@ > putp(s); > } > >-static char * >+static const char * > my_tgetstr(char *s, char *ss) { >- return tigetstr(ss); >+ const char* ret = tigetstr(ss); >+ if (!ret || ret==(char*)-1) >+ return ""; >+ else >+ return ret; > } > > #elif defined(HAVE_LIBTERMCAP) >@@ -110,14 +114,20 @@ > tputs (s, 1, putchar); > } > >-static char * >+static const char * > my_tgetstr(char *s, char *ss) { >- return tgetstr(s, &strbuf); >+ const char* ret = tgetstr(s, &strbuf); >+ if (!ret) >+ return ""; >+ else >+ return ret; > } > > #endif > const char *term=""; > const char *Senter="", *Sexit="";/* enter and exit standout mode */ >+int Slen; /* strlen of Senter+Sexit */ >+char *Hrow; /* pointer to highlighted row in month */ > > #ifdef HAVE_LANGINFO_H > # include <langinfo.h> >@@ -262,6 +272,7 @@ > if (ret > 0) { > Senter = my_tgetstr("so","smso"); > Sexit = my_tgetstr("se","rmso"); >+ Slen = strlen(Senter) + strlen(Sexit); > } > } > #endif >@@ -437,11 +448,18 @@ > sprintf(out->s[1],"%s", > julian ? j_day_headings : day_headings); > for (row = 0; row < 6; row++) { >- for (col = 0, p = lineout; col < 7; col++) >- p = ascii_day(p, days[row * 7 + col]); >+ int has_hl = 0; >+ for (col = 0, p = lineout; col < 7; col++) { >+ int xd = days[row * 7 + col]; >+ if (xd != SPACE && (xd & TODAY_FLAG)) >+ has_hl = 1; >+ p = ascii_day(p, xd); >+ } > *p = '\0'; > trim_trailing_spaces(lineout); > sprintf(out->s[row+2], "%s", lineout); >+ if (has_hl) >+ Hrow = out->s[row+2]; > } > } > >@@ -489,14 +507,25 @@ > do_monthly(day, prev_month, prev_year, &out_prev); > do_monthly(day, month, year, &out_curm); > do_monthly(day, next_month, next_year, &out_next); >+ > width = (julian ? J_WEEK_LEN : WEEK_LEN) -1; > for (i = 0; i < 2; i++) > printf("%s %s %s\n", out_prev.s[i], out_curm.s[i], out_next.s[i]); > for (i = 2; i < FMT_ST_LINES; i++) { >+ int w1, w2, w3; >+ w1 = w2 = w3 = width; >+ >+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP) >+ /* adjust width to allow for non printable characters */ >+ w1 += (out_prev.s[i] == Hrow ? Slen : 0); >+ w2 += (out_curm.s[i] == Hrow ? Slen : 0); >+ w3 += (out_next.s[i] == Hrow ? Slen : 0); >+#endif > snprintf(lineout, SIZE(lineout), "%-*s %-*s %-*s\n", >- width, out_prev.s[i], >- width, out_curm.s[i], >- width, out_next.s[i]); >+ w1, out_prev.s[i], >+ w2, out_curm.s[i], >+ w3, out_next.s[i]); >+ > #if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP) > my_putstring(lineout); > #else >--- util-linux-2.13-pre7/configure.ac.kzak 2007-07-09 14:54:48.000000000 +0200 >+++ util-linux-2.13-pre7/configure.ac 2007-07-09 14:55:11.000000000 +0200 >@@ -71,6 +71,7 @@ > if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes; then > have_ncurses=yes > AC_MSG_NOTICE([you have ncurses]) >+ AC_DEFINE(HAVE_NCURSES, 1, [Do we have -lncurses?]) > else > AC_MSG_NOTICE([you do not have ncurses]) > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 458055
: 313558