diff --git a/src/calendar.c b/src/calendar.c index ee5f11cc..c47d6c43 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -902,11 +902,11 @@ static void DoCalendarOneWeek(int nleft) } Backgroundize(d); PrintLeft(buf, ColSpaces-1, '*'); + putchar(' '); + UnBackgroundize(d); if (UseVTColors) { printf("\x1B[0m"); /* Normal */ } - putchar(' '); - UnBackgroundize(d); } else { Backgroundize(d); PrintLeft(buf, ColSpaces, ' '); @@ -1128,10 +1128,10 @@ static int WriteCalendarRow(void) } Backgroundize(d+i-wd); PrintLeft(buf, ColSpaces-1, '*'); + putchar(' '); if (UseVTColors) { printf("\x1B[0m"); /* Normal */ } - putchar(' '); UnBackgroundize(d+i-wd); } else { Backgroundize(d+i-wd); @@ -1204,15 +1204,17 @@ static void PrintLeft(char const *s, int width, char pad) { #ifndef REM_USE_WCHAR int len = strlen(s); - printf("%s", s); - while (len++ < width) putchar(pad); + int i; + for (i=0; i width) { + break; + } + i += wcwidth(*ws); PutWideChar(*ws++, NULL); - i+= wcwidth(*ws); } else { break; } @@ -1250,7 +1255,10 @@ static void PrintLeft(char const *s, int width, char pad) /* Possibly send lrm control sequence */ send_lrm(); - for (i=display_len; i width) { + break; } + i += wcwidth(*ws); + PutWideChar(*ws++, NULL); } else { break; } @@ -1333,7 +1342,10 @@ static void PrintCentered(char const *s, int width, char *pad) /* Possibly send lrm control sequence */ send_lrm(); - for (i=d+display_len; i