Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2016 21:23:13 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300078 - head/lib/libstand
Message-ID:  <201605172123.u4HLND4w092911@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue May 17 21:23:13 2016
New Revision: 300078
URL: https://svnweb.freebsd.org/changeset/base/300078

Log:
  Add support for %S to libstand as well so /boot/loader and friends can
  use it.

Modified:
  head/lib/libstand/printf.c

Modified: head/lib/libstand/printf.c
==============================================================================
--- head/lib/libstand/printf.c	Tue May 17 20:53:56 2016	(r300077)
+++ head/lib/libstand/printf.c	Tue May 17 21:23:13 2016	(r300078)
@@ -204,6 +204,7 @@ kvprintf(char const *fmt, kvprintf_fn_t 
 	char nbuf[MAXNBUF];
 	char *d;
 	const char *p, *percent, *q;
+	uint16_t *S;
 	u_char *up;
 	int ch, n;
 	uintmax_t num;
@@ -398,6 +399,10 @@ reswitch:	switch (ch = (u_char)*fmt++) {
 				while (width--)
 					PCHAR(padc);
 			break;
+		case 'S':	/* Assume console can cope with wide chars */
+			for (S = va_arg(ap, uint16_t *); *S != 0; S++)
+				PCHAR(*S);
+ 			break;
 		case 't':
 			tflag = 1;
 			goto reswitch;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605172123.u4HLND4w092911>