From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: [PATCH v3 4/5] teach config --blob option to parse config from database Date: Fri, 10 May 2013 00:30:39 +0200 Message-ID: <20130509223038.GB30774@sigill.intra.peff.net> References: <20130509154020.GA26423@book-mint> <20130509162018.GF3526@book-mint> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Junio C Hamano , git@vger.kernel.org, Jens Lehmann , Ramsay Jones To: Heiko Voigt X-From: git-owner@vger.kernel.org Fri May 10 00:30:49 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UaZMO-000605-R9 for gcvg-git-2@plane.gmane.org; Fri, 10 May 2013 00:30:49 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756980Ab3EIWao (ORCPT ); Thu, 9 May 2013 18:30:44 -0400 Received: from cloud.peff.net ([50.56.180.127]:42222 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756973Ab3EIWan (ORCPT ); Thu, 9 May 2013 18:30:43 -0400 Received: (qmail 15923 invoked by uid 102); 9 May 2013 22:31:05 -0000 Received: from Unknown (HELO sigill.intra.peff.net) (213.221.117.228) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Thu, 09 May 2013 17:31:05 -0500 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Fri, 10 May 2013 00:30:39 +0200 Content-Disposition: inline In-Reply-To: <20130509162018.GF3526@book-mint> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, May 09, 2013 at 06:20:18PM +0200, Heiko Voigt wrote: > +static int config_buf_fgetc(struct config_source *conf) > +{ > + if (conf->buf.pos < conf->buf.len && conf->buf.buf[conf->buf.pos]) > + return conf->buf.buf[conf->buf.pos++]; > + > + return EOF; > +} It probably would not matter for config reading, but is there any reason not to make your fgetc replacement 8-bit clean (i.e., to check only len, and not worry about NUL characters)? -Peff