Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libutil also handle the separator after the F field.
details: https://anonhg.NetBSD.org/src/rev/49b416e3e6af
branches: trunk
changeset: 772985:49b416e3e6af
user: christos <christos%NetBSD.org@localhost>
date: Mon Jan 23 03:22:41 2012 +0000
description:
also handle the separator after the F field.
diffstat:
common/lib/libutil/snprintb.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diffs (52 lines):
diff -r 1fcd55a2bd45 -r 49b416e3e6af common/lib/libutil/snprintb.c
--- a/common/lib/libutil/snprintb.c Mon Jan 23 02:34:01 2012 +0000
+++ b/common/lib/libutil/snprintb.c Mon Jan 23 03:22:41 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: snprintb.c,v 1.6 2012/01/23 02:34:01 christos Exp $ */
+/* $NetBSD: snprintb.c,v 1.7 2012/01/23 03:22:41 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
# include <sys/cdefs.h>
# if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: snprintb.c,v 1.6 2012/01/23 02:34:01 christos Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.7 2012/01/23 03:22:41 christos Exp $");
# endif
# include <sys/types.h>
@@ -51,7 +51,7 @@
# include <errno.h>
# else
# include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.6 2012/01/23 02:34:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.7 2012/01/23 03:22:41 christos Exp $");
# include <sys/param.h>
# include <sys/inttypes.h>
# include <sys/systm.h>
@@ -137,7 +137,7 @@
STORE('<'); \
} else { \
/* Remember separator location */ \
- if ( l_max > 0 && sep != '<') { \
+ if (l_max > 0 && sep != '<') { \
s_len = l_len; \
s_bp = bp; \
s_fmt = cur_fmt; \
@@ -210,13 +210,12 @@
field = (val >> bit) &
(((uint64_t)1 << f_len) - 1);
PUTSEP;
+ if (restart == 0)
+ sep = ',';
if (ch == 'F') /* just extract */
break;
if (restart == 0) {
- sep = ',';
PUTS(bitfmt);
- }
- if (restart == 0) {
PUTCHR('=');
}
if (restart == 0) {
Home |
Main Index |
Thread Index |
Old Index