From owner-svn-src-head@freebsd.org Sun Jun 21 11:42:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D547C34B586; Sun, 21 Jun 2020 11:42:49 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49qVyx5HqKz3XZw; Sun, 21 Jun 2020 11:42:49 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B08F51CA3B; Sun, 21 Jun 2020 11:42:49 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05LBgnAW091078; Sun, 21 Jun 2020 11:42:49 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05LBgnDa091077; Sun, 21 Jun 2020 11:42:49 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <202006211142.05LBgnDa091077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sun, 21 Jun 2020 11:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362464 - head/usr.bin/w X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.bin/w X-SVN-Commit-Revision: 362464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2020 11:42:49 -0000 Author: yuripv Date: Sun Jun 21 11:42:49 2020 New Revision: 362464 URL: https://svnweb.freebsd.org/changeset/base/362464 Log: w: use locale-based string format specifiers Use locale-based string format specifiers when printing the process names/arguments. Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D25174 Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Sun Jun 21 10:09:34 2020 (r362463) +++ head/usr.bin/w/w.c Sun Jun 21 11:42:49 2020 (r362464) @@ -438,8 +438,8 @@ main(int argc, char *argv[]) if (ptr == NULL) ptr = "-"; xo_open_instance("process-entry"); - xo_emit("\t\t{:process-id/%-9d/%d} {:command/%s}\n", - dkp->ki_pid, ptr); + xo_emit("\t\t{:process-id/%-9d/%d} " + "{:command/%hs}\n", dkp->ki_pid, ptr); xo_close_instance("process-entry"); } xo_close_list("process-entry"); @@ -460,7 +460,7 @@ main(int argc, char *argv[]) t = ep->utmp.ut_tv.tv_sec; longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); - xo_emit("{:command/%.*s/%@*@s}\n", + xo_emit("{:command/%.*hs/%@*@hs}\n", argwidth - longidle - longattime, ep->args);