svn commit: r362464 - head/usr.bin/w

Yuri Pankov yuripv at FreeBSD.org
Sun Jun 21 11:42:49 UTC 2020


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);
 


More information about the svn-src-head mailing list