Re: [PATCH 1/3] test: add functions to count how much times notmuch was called
[notmuch-archives.git] / b2 / 2526380961b9bdd5dd17a83d69f49cc10aa587
1 Return-Path: <cworth@cworth.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 A0C284196F2\r
6         for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 08:59:52 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.89\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]\r
13         autolearn=ham\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 TZIevhlelrAr; Tue, 20 Apr 2010 08:59:51 -0700 (PDT)\r
17 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
18         by olra.theworths.org (Postfix) with ESMTP id 4ED35431FC1;\r
19         Tue, 20 Apr 2010 08:59:51 -0700 (PDT)\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
21         id 6CA6525400A; Tue, 20 Apr 2010 08:59:52 -0700 (PDT)\r
22 From: Carl Worth <cworth@cworth.org>\r
23 To: Anthony Towns <aj@erisian.com.au>, David Edmondson <dme@dme.org>\r
24 Subject: Re: [PATCH] json: Avoid calling strlen(NULL)\r
25 In-Reply-To: <h2y87b3a4191004060117v5421db8ejbe3030d0626e7440@mail.gmail.com>\r
26 References: <877holavq5.fsf@ut.hh.sledj.net>\r
27         <h2y87b3a4191004060117v5421db8ejbe3030d0626e7440@mail.gmail.com>\r
28 Date: Tue, 20 Apr 2010 08:59:52 -0700\r
29 Message-ID: <878w8iw1vr.fsf@yoom.home.cworth.org>\r
30 MIME-Version: 1.0\r
31 Content-Type: multipart/signed; boundary="=-=-=";\r
32         micalg=pgp-sha1; protocol="application/pgp-signature"\r
33 Cc: notmuch <notmuch@notmuchmail.org>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Tue, 20 Apr 2010 15:59:52 -0000\r
47 \r
48 --=-=-=\r
49 Content-Transfer-Encoding: quoted-printable\r
50 \r
51 > There's already a check in json_quote_chararray for len=3D=3D0, so it\r
52 > might be sensible to say:\r
53 >=20\r
54 >     return (json_quote_chararray (ctx, str, str !=3D NULL ? strlen (str) =\r
55 : 0));\r
56 >=20\r
57 > OTOH, the code in json_quote_array to deal with that does the same\r
58 > thing (returns a literal string containing two quote marks), which\r
59 > seems wrong -- the normal code path is to talloc to get a newly\r
60 > allocated, editable string, that might be talloc_free'd later,\r
61 > wouldn't it make more sense just to let the str=3D=3DNULL / len=3D=3D0\r
62 > behaviour fall through into the normal case code?\r
63 \r
64 Yes, that's the correct analysis. Thanks so much.\r
65 \r
66 > commit 5b93a488221b50c02db18d86a550cb3c038c00da\r
67 > Author: Anthony <aj@erisian.com.au>\r
68 > Date:   Tue Apr 6 18:10:39 2010 +1000\r
69 >=20\r
70 >     json: Avoid calling strlen(NULL), and always return a newly\r
71 >     talloced array.\r
72 \r
73 \r
74 I've pushed this out now, (separated into two pieces).\r
75 \r
76 =2DCarl\r
77 \r
78 --=-=-=\r
79 Content-Type: application/pgp-signature\r
80 \r
81 -----BEGIN PGP SIGNATURE-----\r
82 Version: GnuPG v1.4.10 (GNU/Linux)\r
83 \r
84 iD8DBQFLzc946JDdNq8qSWgRAsP1AJ9fgpBe6+hZRrq8FRJV3l50kzpv8QCfcal/\r
85 i0IWzEcB2C/hBqtiZ3VIu2Q=\r
86 =N51E\r
87 -----END PGP SIGNATURE-----\r
88 --=-=-=--\r