[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / f3 / f4c7c65ddf96787598a2a79da62215b07bcdf3
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 5596B431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 15:21:14 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id mCffs3Wdg9jU for <notmuch@notmuchmail.org>;\r
16         Sat, 15 Dec 2012 15:21:13 -0800 (PST)\r
17 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
18         [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 90031431FB6\r
21         for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 15:21:13 -0800 (PST)\r
22 Received: by mail-lb0-f181.google.com with SMTP id ge1so3677411lbb.26\r
23         for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 15:21:12 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type:x-gm-message-state;\r
28         bh=MOqD5O13QkhyqjrXlfbSVRQQCwlYc7EV0orGni2VkD0=;\r
29         b=anqjtj8CbbzSKIxitZeMUxhYKNIlvdMD8d84KVKfzPor0GebfbnyD17ay9zxtULHJ/\r
30         6yPh5TZOviGbHyN1dJZNQY/1tXvkgQ36ZaBmmgOWhiQt5n9bCM2JWDqd8eoKuSFLF2+e\r
31         EgDBlIcq47kT8hbBy44XNNbIQsNfa0tHAwpuLC8Rf8QR9C0+KI8fMWwc0EFVh8IGnmDN\r
32         5YWjtppFtOHva3NiOa3cDnGSy0L/hFrDFoAuO0D0IOFpYAkdbNR9FxrLNfRtyrMefITj\r
33         LnOo3kOulMPPB3FlrG52Qp4oD/+dOyKGiHyEFJBOGSslh3F8TB/MjG5UKzFvHChXGOtP\r
34         URAA==\r
35 Received: by 10.152.114.65 with SMTP id je1mr6640908lab.33.1355613672076;\r
36         Sat, 15 Dec 2012 15:21:12 -0800 (PST)\r
37 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
38         [80.223.81.27])\r
39         by mx.google.com with ESMTPS id fb1sm3279699lbb.15.2012.12.15.15.21.10\r
40         (version=SSLv3 cipher=OTHER); Sat, 15 Dec 2012 15:21:11 -0800 (PST)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: david@tethera.net, notmuch@notmuchmail.org\r
43 Subject: Re: [Patch v7 05/14] quote_and_decode_query: new function to quote\r
44         hex-decoded queries\r
45 In-Reply-To: <1355492062-7546-6-git-send-email-david@tethera.net>\r
46 References: <1355492062-7546-1-git-send-email-david@tethera.net>\r
47         <1355492062-7546-6-git-send-email-david@tethera.net>\r
48 User-Agent: Notmuch/0.14+138~g7041c56 (http://notmuchmail.org) Emacs/23.4.1\r
49         (i686-pc-linux-gnu)\r
50 Date: Sun, 16 Dec 2012 01:21:08 +0200\r
51 Message-ID: <87mwxeq4uz.fsf@nikula.org>\r
52 MIME-Version: 1.0\r
53 Content-Type: text/plain; charset=us-ascii\r
54 X-Gm-Message-State:\r
55  ALoCoQkUugskuohKOrRftlHv/wUvcjLnxsM49B3UxoB6X5CfSmD6cFsmNI8C2x+C07LMBSzoLhx0\r
56 Cc: David Bremner <bremner@debian.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: Sat, 15 Dec 2012 23:21:15 -0000\r
70 \r
71 On Fri, 14 Dec 2012, david@tethera.net wrote:\r
72 > From: David Bremner <bremner@debian.org>\r
73 >\r
74 > The query is split into tokens, with ' ' and ':' as delimiters.  Any\r
75 > token containing some hex-escaped character is quoted according to\r
76 > Xapian rules.  This maps id:foo%20%22bar to id:"foo ""bar".\r
77 > This intentionally does not quote prefixes, so they still work as prefixes.\r
78 > ---\r
79 >  tag-util.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
80 >  1 file changed, 50 insertions(+)\r
81 >\r
82 > diff --git a/tag-util.c b/tag-util.c\r
83 > index f89669a..e1181f8 100644\r
84 > --- a/tag-util.c\r
85 > +++ b/tag-util.c\r
86 > @@ -56,6 +56,56 @@ illegal_tag (const char *tag, notmuch_bool_t remove)\r
87 >      return NULL;\r
88 >  }\r
89 >  \r
90 > +static tag_parse_status_t\r
91 > +quote_and_decode_query (void *ctx, char *encoded, const char *line_for_error,\r
92 > +                     char **query_string)\r
93 > +{\r
94 > +    char *tok = encoded;\r
95 > +    size_t tok_len = 0;\r
96 > +    char *buf = NULL;\r
97 > +    size_t buf_len = 0;\r
98 > +    tag_parse_status_t ret = TAG_PARSE_SUCCESS;\r
99 > +\r
100 > +    *query_string = talloc_strdup (ctx, "");\r
101 > +\r
102 > +    while (*query_string &&\r
103 > +        (tok = strtok_len (tok + tok_len, ": ", &tok_len)) != NULL) {\r
104 \r
105 strtok_len() will eat all the leading delimiters at each call, and will\r
106 not return a zero-length token if you have multiple consecutive\r
107 delimiters. Which means you may end up losing stuff here. Whether that\r
108 matters or not I'm too tired to tell...\r
109 \r
110 BR,\r
111 Jani.\r
112 \r
113 \r
114 > +     char delim = tok[tok_len];\r
115 > +\r
116 > +     *(tok + tok_len++) = '\0';\r
117 > +\r
118 > +     if (strcspn (tok, "%") < tok_len - 1) {\r
119 > +         /* something to decode */\r
120 > +         if (hex_decode_inplace (tok) != HEX_SUCCESS) {\r
121 > +             ret = line_error (TAG_PARSE_INVALID, line_for_error,\r
122 > +                               "hex decoding of token '%s' failed", tok);\r
123 > +             goto DONE;\r
124 > +         }\r
125 > +\r
126 > +         if (double_quote_str (ctx, tok, &buf, &buf_len)) {\r
127 > +             ret = line_error (TAG_PARSE_OUT_OF_MEMORY,\r
128 > +                               line_for_error, "aborting");\r
129 > +             goto DONE;\r
130 > +         }\r
131 > +         *query_string = talloc_asprintf_append_buffer (\r
132 > +             *query_string, "%s%c", buf, delim);\r
133 > +\r
134 > +     } else {\r
135 > +         /* This is not just an optimization, but used to preserve\r
136 > +          * prefixes like id:, which cannot be quoted.\r
137 > +          */\r
138 > +         *query_string = talloc_asprintf_append_buffer (\r
139 > +             *query_string, "%s%c", tok, delim);\r
140 > +     }\r
141 > +\r
142 > +    }\r
143 > +\r
144 > +  DONE:\r
145 > +    if (ret != TAG_PARSE_SUCCESS && *query_string)\r
146 > +     talloc_free (*query_string);\r
147 > +    return ret;\r
148 > +}\r
149 > +\r
150 >  tag_parse_status_t\r
151 >  parse_tag_line (void *ctx, char *line,\r
152 >               tag_op_flag_t flags,\r
153 > -- \r
154 > 1.7.10.4\r
155 >\r
156 > _______________________________________________\r
157 > notmuch mailing list\r
158 > notmuch@notmuchmail.org\r
159 > http://notmuchmail.org/mailman/listinfo/notmuch\r