From owner-svn-src-all@FreeBSD.ORG Thu May 21 04:49:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424C4106566B; Thu, 21 May 2009 04:49:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBF28FC08; Thu, 21 May 2009 04:49:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L4n36i055005; Thu, 21 May 2009 04:49:03 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L4n3O8055004; Thu, 21 May 2009 04:49:03 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200905210449.n4L4n3O8055004@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 21 May 2009 04:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192521 - stable/7/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 04:49:03 -0000 Author: ru Date: Thu May 21 04:49:02 2009 New Revision: 192521 URL: http://svn.freebsd.org/changeset/base/192521 Log: Fixed multi-byte character support to actually work. Modified: stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/ncal/ncal.c Modified: stable/7/usr.bin/ncal/ncal.c ============================================================================== --- stable/7/usr.bin/ncal/ncal.c Thu May 21 04:44:21 2009 (r192520) +++ stable/7/usr.bin/ncal/ncal.c Thu May 21 04:49:02 2009 (r192521) @@ -423,7 +423,7 @@ printmonth(int y, int m, int jd_flag) mkweekdays(&wds); printf(" %ls %d\n", month.name, y); for (i = 0; i != 7; i++) - printf("%.2ls%s\n", wds.names[i], month.lines[i]); + wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); if (flag_weeks) printf(" %s\n", month.weeks); } @@ -479,17 +479,17 @@ printyear(int y, int jd_flag) printf("%s\n", center(t, s, mpl * mw)); for (j = 0; j != 12; j += mpl) { - printf(" %-*ls%-*ls", + wprintf(L" %-*ls%-*ls", mw, year[j].name, mw, year[j + 1].name); if (mpl == 3) printf("%ls\n", year[j + 2].name); else - printf("%-*ls%ls\n", + wprintf(L"%-*ls%ls\n", mw, year[j + 2].name, year[j + 3].name); for (i = 0; i != 7; i++) { - printf("%.2ls%-*s%-*s", + wprintf(L"%.2ls%-*s%-*s", wds.names[i], mw, year[j].lines[i], mw, year[j + 1].lines[i]); @@ -537,11 +537,11 @@ printyearb(int y, int jd_flag) printf("%s\n\n", center(t, s, mw * mpl + mpl)); for (j = 0; j != 12; j += mpl) { - printf("%-*ls ", mw, wcenter(ws, year[j].name, mw)); + wprintf(L"%-*ls ", mw, wcenter(ws, year[j].name, mw)); if (mpl == 2) printf("%ls\n", wcenter(ws, year[j + 1].name, mw)); else - printf("%-*ls %ls\n", mw, + wprintf(L"%-*ls %ls\n", mw, wcenter(ws, year[j + 1].name, mw), wcenter(wt, year[j + 2].name, mw));