From 70e91904ffd8c9f667acff5b39d704696012cdb4 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 15 Nov 2012 21:33:20 +2000 Subject: [PATCH] [PATCH 1/3] notmuch-tag: tidy formatting --- 1a/04bba85d93c5750698c27e8941d45b27d205fb | 125 ++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 1a/04bba85d93c5750698c27e8941d45b27d205fb diff --git a/1a/04bba85d93c5750698c27e8941d45b27d205fb b/1a/04bba85d93c5750698c27e8941d45b27d205fb new file mode 100644 index 000000000..9188471cc --- /dev/null +++ b/1a/04bba85d93c5750698c27e8941d45b27d205fb @@ -0,0 +1,125 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 8C902431FC2 + for ; Wed, 14 Nov 2012 17:33:42 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 6fSOOPncOaEo for ; + Wed, 14 Nov 2012 17:33:41 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E1BB0431FC0 + for ; Wed, 14 Nov 2012 17:33:40 -0800 (PST) +Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.89.108] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1TYoKq-0007YX-4z; Wed, 14 Nov 2012 21:33:40 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1TYoKk-0000U1-KF; Wed, 14 Nov 2012 21:33:34 -0400 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH 1/3] notmuch-tag: tidy formatting +Date: Wed, 14 Nov 2012 21:33:20 -0400 +Message-Id: <1352943202-1431-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1352943202-1431-1-git-send-email-david@tethera.net> +References: <1352943202-1431-1-git-send-email-david@tethera.net> +X-Spam_bar: - +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 15 Nov 2012 01:33:43 -0000 + +From: David Bremner + +This is just the result of running uncrustify. +--- + notmuch-tag.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/notmuch-tag.c b/notmuch-tag.c +index d15f1ed..88d559b 100644 +--- a/notmuch-tag.c ++++ b/notmuch-tag.c +@@ -31,7 +31,7 @@ handle_sigint (unused (int sig)) + * result. It is not required for correctness, and if it does + * fail or produce a short write, we want to get out of the signal + * handler as quickly as possible, not retry it. */ +- IGNORE_RESULT (write (2, msg, sizeof(msg)-1)); ++ IGNORE_RESULT (write (2, msg, sizeof (msg) - 1)); + interrupted = 1; + } + +@@ -40,6 +40,7 @@ _escape_tag (char *buf, const char *tag) + { + const char *in = tag; + char *out = buf; ++ + /* Boolean terms surrounded by double quotes can contain any + * character. Double quotes are quoted by doubling them. */ + *out++ = '"'; +@@ -85,8 +86,8 @@ _optimize_tag_query (void *ctx, const char *orig_query_string, + for (i = 0; tag_ops[i].tag; i++) + if (strlen (tag_ops[i].tag) > max_tag_len) + max_tag_len = strlen (tag_ops[i].tag); +- escaped = talloc_array(ctx, char, max_tag_len * 2 + 3); +- if (!escaped) ++ escaped = talloc_array (ctx, char, max_tag_len * 2 + 3); ++ if (! escaped) + return NULL; + + /* Build the new query string */ +@@ -140,9 +141,8 @@ tag_query (void *ctx, notmuch_database_t *notmuch, const char *query_string, + notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED); + + for (messages = notmuch_query_search_messages (query); +- notmuch_messages_valid (messages) && !interrupted; +- notmuch_messages_move_to_next (messages)) +- { ++ notmuch_messages_valid (messages) && ! interrupted; ++ notmuch_messages_move_to_next (messages)) { + message = notmuch_messages_get (messages); + + notmuch_message_freeze (message); +@@ -204,14 +204,14 @@ notmuch_tag_command (void *ctx, int argc, char *argv[]) + } + if (argv[i][0] == '+' || argv[i][0] == '-') { + if (argv[i][0] == '+' && argv[i][1] == '\0') { +- fprintf(stderr, "Error: tag names cannot be empty.\n"); ++ fprintf (stderr, "Error: tag names cannot be empty.\n"); + return 1; + } + if (argv[i][0] == '+' && argv[i][1] == '-') { + /* This disallows adding the non-removable tag "-" and + * enables notmuch tag to take long options in the + * future. */ +- fprintf(stderr, "Error: tag names must not start with '-'.\n"); ++ fprintf (stderr, "Error: tag names must not start with '-'.\n"); + return 1; + } + tag_ops[tag_ops_count].tag = argv[i] + 1; +-- +1.7.10.4 + -- 2.26.2