From e62bbc5df185d4e20506f148b4bb5239807fcaa4 Mon Sep 17 00:00:00 2001 From: abhinav Date: Sun, 30 Apr 2017 08:41:18 +0000 Subject: [PATCH] Avoid a call to strncmp when comparing only the first character of the string. --- usr.sbin/makemandb/makemandb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makemandb/makemandb.c b/usr.sbin/makemandb/makemandb.c index 640f39ee74dc..bfe2210d8837 100644 --- a/usr.sbin/makemandb/makemandb.c +++ b/usr.sbin/makemandb/makemandb.c @@ -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 * Copyright (c) 2011 Kristaps Dzonsons @@ -17,7 +17,7 @@ */ #include -__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 #include @@ -519,7 +519,7 @@ traversedir(const char *parent, const char *file, sqlite3 *db, 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);