database error
[notmuch-archives.git] / f9 / 6570a876dc0d4ff1f36a9bd8b0aeb34281f555
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2FCE3431FB6\r
6         for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:54:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 92e17x6fqpmf for <notmuch@notmuchmail.org>;\r
17         Mon, 22 Sep 2014 02:54:54 -0700 (PDT)\r
18 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
19         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 46F16431FC3\r
22         for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:54:51 -0700 (PDT)\r
23 Received: by mail-wi0-f181.google.com with SMTP id z2so2607626wiv.8\r
24         for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:54:50 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=1e100.net; s=20130820;\r
27         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
28         :references:in-reply-to:references;\r
29         bh=BnALWtTzG3/QUxA4HNgdSMGE4TMNTwo6KMYLSHf6SPA=;\r
30         b=L2P9Q3sP2CFs9NWnhbEGYGlHfMKCp+87z3q/wOP5vo6Z11gRihk62qX26ZoNeO7QEP\r
31         7VKybyMTAiukg6ZFr62NhO1x1zplwzPQH5ah2FO5jY0IdLERNv8qYc8n5XUCaYgl50cX\r
32         9bxN60qSaFC/Xvr08fCJedNuFRQHKv0E+hOGfDaG49g59UXoG4r7vHGYvw6AH1ENtJ/G\r
33         4zGJfdYEuHf6BZY5fXWCbbim2lJOYBXvP9yhvwGXugqmFR3F7XLrCH5AfsKjaqN783jV\r
34         yo7eR0fzIcrQKll0ZnWN8VCAtCncQv2kgxfd7zdVdswkp/lqxrfk/pYI1oFzGA3oO1lI\r
35         G6kA==\r
36 X-Gm-Message-State:\r
37  ALoCoQkz2tKQNPv4itfIvO5a9g8EhXpeNp449lNSzPo1sLIT5WJ+XCw1idlOZmoYSjdpZ4ONSPKA\r
38 X-Received: by 10.194.203.8 with SMTP id km8mr19296884wjc.51.1411379690249;\r
39         Mon, 22 Sep 2014 02:54:50 -0700 (PDT)\r
40 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
41         by mx.google.com with ESMTPSA id mc4sm4390990wic.6.2014.09.22.02.54.49\r
42         for <multiple recipients>\r
43         (version=TLSv1.1 cipher=RC4-SHA bits=128/128);\r
44         Mon, 22 Sep 2014 02:54:49 -0700 (PDT)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH 02/11] cli/insert: rename check_folder_name to\r
48         is_valid_folder_name\r
49 Date: Mon, 22 Sep 2014 11:54:53 +0200\r
50 Message-Id:\r
51  <bbd8752e33eb89136c06af49e7d388455666a00a.1411379395.git.jani@nikula.org>\r
52 X-Mailer: git-send-email 1.7.2.5\r
53 In-Reply-To: <cover.1411379395.git.jani@nikula.org>\r
54 References: <cover.1411379395.git.jani@nikula.org>\r
55 In-Reply-To: <cover.1411379395.git.jani@nikula.org>\r
56 References: <cover.1411379395.git.jani@nikula.org>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Mon, 22 Sep 2014 09:54:59 -0000\r
70 \r
71 An "is something" predicate conveys the meaning better. While at it,\r
72 improve the function documentation and error message. Besides the\r
73 error message change, no functional changes.\r
74 ---\r
75  notmuch-insert.c |   13 ++++++++-----\r
76  1 files changed, 8 insertions(+), 5 deletions(-)\r
77 \r
78 diff --git a/notmuch-insert.c b/notmuch-insert.c\r
79 index 8dfc8bb..770275b 100644\r
80 --- a/notmuch-insert.c\r
81 +++ b/notmuch-insert.c\r
82 @@ -83,10 +83,13 @@ sync_dir (const char *dir)\r
83      return ret;\r
84  }\r
85  \r
86 -/* Check the specified folder name does not contain a directory\r
87 - * component ".." to prevent writes outside of the Maildir hierarchy. */\r
88 +/*\r
89 + * Check the specified folder name does not contain a directory\r
90 + * component ".." to prevent writes outside of the Maildir\r
91 + * hierarchy. Return TRUE on valid folder name, FALSE otherwise.\r
92 + */\r
93  static notmuch_bool_t\r
94 -check_folder_name (const char *folder)\r
95 +is_valid_folder_name (const char *folder)\r
96  {\r
97      const char *p = folder;\r
98  \r
99 @@ -449,8 +452,8 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])\r
100      if (folder == NULL) {\r
101         maildir = db_path;\r
102      } else {\r
103 -       if (! check_folder_name (folder)) {\r
104 -           fprintf (stderr, "Error: bad folder name: %s\n", folder);\r
105 +       if (! is_valid_folder_name (folder)) {\r
106 +           fprintf (stderr, "Error: invalid folder name: '%s'\n", folder);\r
107             return EXIT_FAILURE;\r
108         }\r
109         maildir = talloc_asprintf (config, "%s/%s", db_path, folder);\r
110 -- \r
111 1.7.2.5\r
112 \r