[Midnightbsd-cvs] src [7593] stable/0.8/usr.bin/msearch: MFC: fix zeroflag code to work with clang
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat May 28 15:03:14 EDT 2016
Revision: 7593
http://svnweb.midnightbsd.org/src/?rev=7593
Author: laffer1
Date: 2016-05-28 15:03:13 -0400 (Sat, 28 May 2016)
Log Message:
-----------
MFC: fix zeroflag code to work with clang
Modified Paths:
--------------
stable/0.8/usr.bin/msearch/Makefile
stable/0.8/usr.bin/msearch/msearch.c
Modified: stable/0.8/usr.bin/msearch/Makefile
===================================================================
--- stable/0.8/usr.bin/msearch/Makefile 2016-05-28 19:02:11 UTC (rev 7592)
+++ stable/0.8/usr.bin/msearch/Makefile 2016-05-28 19:03:13 UTC (rev 7593)
@@ -1,10 +1,9 @@
-# $MidnightBSD: src/usr.bin/msearch/Makefile,v 1.6 2011/08/07 06:25:00 laffer1 Exp $
+# $MidnightBSD$
PROG= msearch
CFLAGS+= -I${.CURDIR}/../../lib/libsearch
-WARNS?= 1
CSTD= c99
DPADD= ${LIBMSEARCH} ${LIBZ} ${LIBSQLITE3}
Modified: stable/0.8/usr.bin/msearch/msearch.c
===================================================================
--- stable/0.8/usr.bin/msearch/msearch.c 2016-05-28 19:02:11 UTC (rev 7592)
+++ stable/0.8/usr.bin/msearch/msearch.c 2016-05-28 19:03:13 UTC (rev 7593)
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD: src/usr.bin/msearch/msearch.c,v 1.6 2011/08/06 23:02:26 laffer1 Exp $");
+__MBSDID("$MidnightBSD$");
#include <stdio.h>
#include <stdlib.h>
@@ -101,15 +101,17 @@
while (current != NULL) {
if (current->path != NULL) {
if (tflag && rflag) {
+ printf("%0.2f %s", current->weight, current->path);
if (zeroflag)
- printf("%0.2f %s\0", current->weight, current->path);
+ fputc('\0', stdout);
else
- printf("%0.2f %s\n", current->weight, current->path);
+ fputc('\n', stdout);
} else {
+ printf("%s", current->path);
if (zeroflag)
- printf("%s\0", current->path);
+ fputc('\0', stdout);
else
- printf("%s\n", current->path);
+ fputc('\n', stdout);
}
}
current = current->next;
More information about the Midnightbsd-cvs
mailing list