--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 6EED66DE0AC2\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Feb 2016 04:57:24 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.308\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.308 tagged_above=-999 required=5 tests=[AWL=0.243,\r
+ RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id NuYj2t_V0f9o for <notmuch@notmuchmail.org>;\r
+ Tue, 9 Feb 2016 04:57:22 -0800 (PST)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 3E0046DE02CE\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Feb 2016 04:57:21 -0800 (PST)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1aT7qP-0000H3-80; Tue, 09 Feb 2016 07:56:37 -0500\r
+Received: (nullmailer pid 10963 invoked by uid 1000);\r
+ Tue, 09 Feb 2016 12:57:15 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v3 01/16] add util/search-path.{c,\r
+ h} to test for executables in $PATH\r
+In-Reply-To: <1454272801-23623-2-git-send-email-dkg@fifthhorseman.net>\r
+References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1454272801-23623-2-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21+5~gca076ce (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 09 Feb 2016 08:57:15 -0400\r
+Message-ID: <87oabqvy6s.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 09 Feb 2016 12:57:24 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+\r
+> +notmuch_bool_t\r
+> +test_for_executable(const char* exename)\r
+> +{\r
+> + char *c = NULL, *save = NULL, *tok;\r
+> + size_t n;\r
+> + int dfd = -1;\r
+\r
+c, dfd, and n could be more meaningful as variable names.\r
+\r
+% uncrustify --config devel/uncrustify.cfg --replace util/search-path.c util/search-path.h\r
+\r
+yields quite a few whitespace changes (diff attached)\r
+\r
+\r
+--=-=-=\r
+Content-Type: text/x-diff\r
+Content-Disposition: inline; filename=wschanges.diff\r
+\r
+diff --git a/util/search-path.c b/util/search-path.c\r
+index 5eac367..39601e4 100644\r
+--- a/util/search-path.c\r
++++ b/util/search-path.c\r
+@@ -9,47 +9,47 @@\r
+ \r
+ \r
+ notmuch_bool_t\r
+-test_for_executable(const char* exename)\r
++test_for_executable (const char *exename)\r
+ {\r
+ char *c = NULL, *save = NULL, *tok;\r
+ size_t n;\r
+ int dfd = -1;\r
+ notmuch_bool_t ret = FALSE;\r
+ \r
+- if (strchr(exename, '/')) {\r
+- if (0 == access(exename, X_OK))\r
++ if (strchr (exename, '/')) {\r
++ if (0 == access (exename, X_OK))\r
+ return TRUE;\r
+ else\r
+ return FALSE;\r
+ }\r
+- \r
+- c = getenv("PATH");\r
++\r
++ c = getenv ("PATH");\r
+ if (c)\r
+- c = talloc_strdup(NULL, c);\r
++ c = talloc_strdup (NULL, c);\r
+ else {\r
+- n = confstr(_CS_PATH, NULL, 0);\r
+- c = (char*)talloc_size(NULL, n);\r
+- if (!c)\r
++ n = confstr (_CS_PATH, NULL, 0);\r
++ c = (char *) talloc_size (NULL, n);\r
++ if (! c)\r
+ return FALSE;\r
+- confstr(_CS_PATH, c, n);\r
++ confstr (_CS_PATH, c, n);\r
+ }\r
+ \r
+- tok = strtok_r(c, ":", &save);\r
++ tok = strtok_r (c, ":", &save);\r
+ while (tok) {\r
+- dfd = open(tok, O_DIRECTORY | O_RDONLY);\r
++ dfd = open (tok, O_DIRECTORY | O_RDONLY);\r
+ if (dfd != -1) {\r
+- if (!faccessat(dfd, exename, X_OK, 0)) {\r
++ if (! faccessat (dfd, exename, X_OK, 0)) {\r
+ ret = TRUE;\r
+ goto done;\r
+ }\r
+- close(dfd);\r
++ close (dfd);\r
+ }\r
+- tok = strtok_r(NULL, ":", &save);\r
++ tok = strtok_r (NULL, ":", &save);\r
+ }\r
+-done:\r
++ done:\r
+ if (dfd != -1)\r
+- close(dfd);\r
++ close (dfd);\r
+ if (c)\r
+- talloc_free(c);\r
++ talloc_free (c);\r
+ return ret;\r
+ }\r
+diff --git a/util/search-path.h b/util/search-path.h\r
+index 727d0b3..14c4d14 100644\r
+--- a/util/search-path.h\r
++++ b/util/search-path.h\r
+@@ -4,13 +4,13 @@\r
+ #include "notmuch.h"\r
+ \r
+ /* can an executable be found with the given name?\r
+- * \r
++ *\r
+ * Return TRUE only if we can find something to execute with the\r
+ * associated name.\r
+ *\r
+ * if the name has a '/' in it, we look for it directly with\r
+ * access(exename, X_OK).\r
+- * \r
++ *\r
+ * otherwise, we look for it in $PATH (or in confstr(_CS_PATH), if\r
+ * $PATH is unset).\r
+ *\r
+@@ -19,6 +19,6 @@\r
+ */\r
+ \r
+ notmuch_bool_t\r
+-test_for_executable(const char *exename);\r
++test_for_executable (const char *exename);\r
+ \r
+ #endif\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+\r
+> + notmuch_bool_t ret = FALSE;\r
+> +\r
+> + if (strchr(exename, '/')) {\r
+> + if (0 == access(exename, X_OK))\r
+> + return TRUE;\r
+> + else\r
+> + return FALSE;\r
+> + }\r
+> + \r
+> + c = getenv("PATH");\r
+> + if (c)\r
+> + c = talloc_strdup(NULL, c);\r
+\r
+Is there some advantage to using the talloc_ functions here?\r
+\r
+> + else {\r
+\r
+Is n needed outside this block? if not, it could be declared here (and\r
+then I don't care about the single letter name).\r
+\r
+> + n = confstr(_CS_PATH, NULL, 0);\r
+\r
+according to a glance at the man page, this might return 0 if there is\r
+no value for _CS_PATH set?\r
+\r
+\r
+> +\r
+> + tok = strtok_r(c, ":", &save);\r
+> + while (tok) {\r
+same comment about block local declaration of dfd\r
+\r
+> + dfd = open(tok, O_DIRECTORY | O_RDONLY);\r
+\r
+> + tok = strtok_r(NULL, ":", &save);\r
+\r
+not sure if it helps, but there is also strtok_len in libutil\r
+\r
+> +done:\r
+\r
+as a real nitpick, we have always (?) used DONE for a label.\r
+\r
+--=-=-=--\r