ALT Linux Bugzilla
– Attachment 886 Details for
Bug 6724
cal неверно форматирует строки при выводе
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Patch for cal.c
util-linux-2.12q-cal-highlighting.patch (text/plain), 929 bytes, created by
Denis Kirienko
on 2005-05-14 22:40:40 MSD
(
hide
)
Description:
Patch for cal.c
Filename:
MIME Type:
Creator:
Denis Kirienko
Created:
2005-05-14 22:40:40 MSD
Size:
929 bytes
patch
obsolete
>--- util-linux-2.12q.orig/misc-utils/cal.c 2004-12-05 22:20:36 +0300 >+++ util-linux-2.12q/misc-utils/cal.c 2005-05-14 22:31:00 +0400 >@@ -234,6 +234,7 @@ > void monthly(int, int, int); > void monthly3(int, int, int); > void trim_trailing_spaces(char *); >+void trim_one_trailing_space(char *); > void usage(void); > void headers_init(void); > extern char *__progname; >@@ -445,7 +446,7 @@ > for (col = 0, p = lineout; col < 7; col++) > p = ascii_day(p, days[row * 7 + col]); > *p = '\0'; >- trim_trailing_spaces(lineout); >+ trim_one_trailing_space(lineout); > sprintf(out->s[row+2], "%s", lineout); > } > } >@@ -716,6 +717,18 @@ > *p = '\0'; > } > >+void >+trim_one_trailing_space(s) >+ char *s; >+{ >+ char *p; >+ >+ for (p = s; *p; ++p) >+ continue; >+ if (p > s && isspace(*--p)) >+ *p = '\0'; >+} >+ > /* > * Center string, handling multibyte characters appropriately. > * In addition if the string is too large for the width it's truncated.
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 6724
: 886