Module Name: src Committed By: abhinav Date: Sun Apr 30 08:41:18 UTC 2017
Modified Files: src/usr.sbin/makemandb: makemandb.c Log Message: Avoid a call to strncmp when comparing only the first character of the string. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/makemandb/makemandb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/makemandb/makemandb.c diff -u src/usr.sbin/makemandb/makemandb.c:1.49 src/usr.sbin/makemandb/makemandb.c:1.50 --- src/usr.sbin/makemandb/makemandb.c:1.49 Sat Apr 29 16:49:51 2017 +++ src/usr.sbin/makemandb/makemandb.c Sun Apr 30 08:41:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: makemandb.c,v 1.49 2017/04/29 16:49:51 abhinav Exp $ */ +/* $NetBSD: makemandb.c,v 1.50 2017/04/30 08:41:18 abhinav Exp $ */ /* * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadh...@gmail.com> * Copyright (c) 2011 Kristaps Dzonsons <krist...@bsd.lv> @@ -17,7 +17,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: makemandb.c,v 1.49 2017/04/29 16:49:51 abhinav Exp $"); +__RCSID("$NetBSD: makemandb.c,v 1.50 2017/04/30 08:41:18 abhinav Exp $"); #include <sys/stat.h> #include <sys/types.h> @@ -519,7 +519,7 @@ traversedir(const char *parent, const ch while ((dirp = readdir(dp)) != NULL) { /* Avoid . and .. entries in a directory */ - if (strncmp(dirp->d_name, ".", 1)) { + if (dirp->d_name[0] != '.') { easprintf(&buf, "%s/%s", file, dirp->d_name); traversedir(parent, buf, db, mp); free(buf);