From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E64EE431FB6 for ; Thu, 5 Apr 2012 04:56:31 -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 yNhlAexuinJ2 for ; Thu, 5 Apr 2012 04:56:31 -0700 (PDT) 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 3121E431FAE for ; Thu, 5 Apr 2012 04:56:31 -0700 (PDT) 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:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1SFlIj-0000js-Iz; Thu, 05 Apr 2012 08:56:29 -0300 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1SFlIe-0000yj-8y; Thu, 05 Apr 2012 08:56:24 -0300 From: David Bremner To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH 3/8] hex-escape: add function to decode escaped string in-place In-Reply-To: <026815054d3e01e6f29c0834d43ccabdf6eda481.1333231401.git.jani@nikula.org> References: <026815054d3e01e6f29c0834d43ccabdf6eda481.1333231401.git.jani@nikula.org>User-Agent: Notmuch/0.12+70~g46e73fe (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 05 Apr 2012 08:56:24 -0300 Message-ID: <87d37mtms7.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam_bar: - 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, 05 Apr 2012 11:56:32 -0000 Jani Nikula writes: > Add function hex_decode_inplace() to decode the input string onto > itself. > > Signed-off-by: Jani Nikula > > --- > > This could be folded to "hex-escape: (en|de)code strings to/from > restricted character set". Probably. It's a bit hard to follow as is; somehow the code movement is a bit noisy. > while (*p) { > - > if (*p == escape_char) { > - unrelated whitespace changes, naughty naughty. > +hex_status_t > +hex_decode_inplace (char *p) > +{ > + return hex_decode_internal (p, (unsigned char *) p); this could probably use a comment to the effect that there _will_ be enough space. > + > + p = in; > + q = (unsigned char *) *out; I understand trying to minimize changes, but do p and q serve any purpose here? > + > + return hex_decode_internal (p, q); > +} > +/* > + * Decode 'in' onto itself. > + */ This is just a bit terse for my taste. d