From: David Bremner Date: Wed, 6 Aug 2014 13:43:33 +0000 (+2100) Subject: Re: [PATCH v3 02/13] util: Const version of strtok_len X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=039106eae2ff6c544807eaec8798f70da4bc33b6;p=notmuch-archives.git Re: [PATCH v3 02/13] util: Const version of strtok_len --- diff --git a/44/0210a7935e86fc63a1a39b8ac039ba3846b71b b/44/0210a7935e86fc63a1a39b8ac039ba3846b71b new file mode 100644 index 000000000..56f2313db --- /dev/null +++ b/44/0210a7935e86fc63a1a39b8ac039ba3846b71b @@ -0,0 +1,64 @@ +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 D1B0D431FAF + for ; Wed, 6 Aug 2014 06:43:43 -0700 (PDT) +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 a9bFl91TbwMF for ; + Wed, 6 Aug 2014 06:43:39 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 26B0F431FAE + for ; Wed, 6 Aug 2014 06:43:39 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1XF1VC-0000EP-7s; Wed, 06 Aug 2014 10:43:38 -0300 +Received: (nullmailer pid 11391 invoked by uid 1000); Wed, 06 Aug 2014 + 13:43:33 -0000 +From: David Bremner +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH v3 02/13] util: Const version of strtok_len +In-Reply-To: <1406859003-11561-3-git-send-email-amdragon@mit.edu> +References: <1406859003-11561-1-git-send-email-amdragon@mit.edu> + <1406859003-11561-3-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.18.1+62~g0c12920 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Wed, 06 Aug 2014 10:43:33 -0300 +Message-ID: <87egwtd98a.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain +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: Wed, 06 Aug 2014 13:43:44 -0000 + +Austin Clements writes: + +> Because of limitations in the C type system, we can't a strtok_len +> that can work on both const string and non-const strings. The C +> library solves this by taking a const char* and returning a char* +> in functions like this (e.g., strchr), but that's not const-safe. +> Solve it by introducing strtok_len_c, a version of strtok_len for +> const strings. + +pushed the first two patches in the series + +d