svn commit: r194447 - head/usr.bin/ncal

Hajimu UMEMOTO ume at FreeBSD.org
Thu Jun 18 16:40:01 UTC 2009


Author: ume
Date: Thu Jun 18 16:40:00 2009
New Revision: 194447
URL: http://svn.freebsd.org/changeset/base/194447

Log:
  Since the width is always 2, it is enough to put just one
  trailing space is enough.
  
  MFC after:	1 week

Modified:
  head/usr.bin/ncal/ncal.c

Modified: head/usr.bin/ncal/ncal.c
==============================================================================
--- head/usr.bin/ncal/ncal.c	Thu Jun 18 15:57:57 2009	(r194446)
+++ head/usr.bin/ncal/ncal.c	Thu Jun 18 16:40:00 2009	(r194447)
@@ -844,7 +844,7 @@ mkweekdays(struct weekdays *wds)
 	for (i = 0; i != 7; i++) {
 		tm.tm_wday = (i+1) % 7;
 		wcsftime(buf, sizeof(buf), L"%a", &tm);
-		for (len = wcslen(buf); len > 0; --len) {
+		for (len = 2; len > 0; --len) {
 			if ((width = wcswidth(buf, len)) <= 2)
 				break;
 		}
@@ -852,7 +852,7 @@ mkweekdays(struct weekdays *wds)
 		if (width == 1)
 			wds->names[i][0] = L' ';
 		wcsncat(wds->names[i], buf, len);
-		wcsncat(wds->names[i], L"  ", 3 - wcswidth(wds->names[i], 2));
+		wcsncat(wds->names[i], L" ", 1);
 	}
 }
 


More information about the svn-src-all mailing list