--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 7ADF6431FC9\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Sep 2014 11:28:58 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id RpYcUtKEuTnj for <notmuch@notmuchmail.org>;\r
+ Sun, 28 Sep 2014 11:28:58 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 16C70431FC7\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Sep 2014 11:28:58 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1XYJDL-0005g0-F2; Sun, 28 Sep 2014 15:28:55 -0300\r
+Received: (nullmailer pid 31285 invoked by uid 1000); Sun, 28 Sep 2014\r
+ 18:28:49 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [WIP 1/3] util: move chomp_newline to string-util.h\r
+Date: Sun, 28 Sep 2014 20:28:17 +0200\r
+Message-Id: <1411928899-29625-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <1411928899-29625-1-git-send-email-david@tethera.net>\r
+References: <87iok8vog6.fsf@steelpick.2x.cz>\r
+ <1411928899-29625-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 28 Sep 2014 18:28:58 -0000\r
+\r
+This allows it to be called from functions in the library, if needed.\r
+\r
+Instead of making all of string-util available to everywhere\r
+notmuch-client.h is included, just add an extra include to the three\r
+places chomp_newline was needed (and string-util.h not yet included).\r
+---\r
+ notmuch-client.h | 7 -------\r
+ notmuch-count.c | 1 +\r
+ notmuch-setup.c | 1 +\r
+ test/hex-xcode.c | 2 ++\r
+ util/string-util.h | 7 +++++++\r
+ 5 files changed, 11 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index e1efbe0..bd01005 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -111,13 +111,6 @@ typedef struct notmuch_show_params {\r
+ #define STRNCMP_LITERAL(var, literal) \\r
+ strncmp ((var), (literal), sizeof (literal) - 1)\r
+ \r
+-static inline void\r
+-chomp_newline (char *str)\r
+-{\r
+- if (str && str[strlen(str)-1] == '\n')\r
+- str[strlen(str)-1] = '\0';\r
+-}\r
+-\r
+ /* Exit status code indicating the requested format version is too old\r
+ * (support for that version has been dropped). CLI code should use\r
+ * notmuch_exit_if_unsupported_format rather than directly exiting\r
+diff --git a/notmuch-count.c b/notmuch-count.c\r
+index 6058f7c..c3f4b54 100644\r
+--- a/notmuch-count.c\r
++++ b/notmuch-count.c\r
+@@ -20,6 +20,7 @@\r
+ */\r
+ \r
+ #include "notmuch-client.h"\r
++#include "string-util.h"\r
+ \r
+ enum {\r
+ OUTPUT_THREADS,\r
+diff --git a/notmuch-setup.c b/notmuch-setup.c\r
+index 36a6171..eb91179 100644\r
+--- a/notmuch-setup.c\r
++++ b/notmuch-setup.c\r
+@@ -19,6 +19,7 @@\r
+ */\r
+ \r
+ #include "notmuch-client.h"\r
++#include "string-util.h"\r
+ \r
+ static const char *\r
+ make_path_absolute (void *ctx, const char *path)\r
+diff --git a/test/hex-xcode.c b/test/hex-xcode.c\r
+index 65d4956..20d0a68 100644\r
+--- a/test/hex-xcode.c\r
++++ b/test/hex-xcode.c\r
+@@ -9,6 +9,8 @@\r
+ \r
+ #include "notmuch-client.h"\r
+ #include "hex-escape.h"\r
++#include "string-util.h"\r
++\r
+ #include <assert.h>\r
+ \r
+ enum direction {\r
+diff --git a/util/string-util.h b/util/string-util.h\r
+index e409cb3..9337770 100644\r
+--- a/util/string-util.h\r
++++ b/util/string-util.h\r
+@@ -64,6 +64,13 @@ int\r
+ parse_boolean_term (void *ctx, const char *str,\r
+ char **prefix_out, char **term_out);\r
+ \r
++static inline void\r
++chomp_newline (char *str)\r
++{\r
++ if (str && str[strlen(str)-1] == '\n')\r
++ str[strlen(str)-1] = '\0';\r
++}\r
++\r
+ #ifdef __cplusplus\r
+ }\r
+ #endif\r
+-- \r
+2.1.0\r
+\r