From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: [PATCH 2/4] xdiff-interface.c: always trim trailing space from xfuncname matches Date: Thu, 9 Sep 2010 15:21:08 -0400 Message-ID: <20100909192108.GC32508@sigill.intra.peff.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: git@vger.kernel.org, Brandon Casey To: Brandon Casey X-From: git-owner@vger.kernel.org Thu Sep 09 21:21:03 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Otmg9-0004gQ-6p for gcvg-git-2@lo.gmane.org; Thu, 09 Sep 2010 21:21:01 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199Ab0IITU4 (ORCPT ); Thu, 9 Sep 2010 15:20:56 -0400 Received: from xen6.gtisc.gatech.edu ([143.215.130.70]:51120 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521Ab0IITUz (ORCPT ); Thu, 9 Sep 2010 15:20:55 -0400 Received: (qmail 21022 invoked by uid 111); 9 Sep 2010 19:20:55 -0000 Received: from 99-108-226-0.lightspeed.iplsin.sbcglobal.net (HELO sigill.intra.peff.net) (99.108.226.0) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.40) with ESMTPA; Thu, 09 Sep 2010 19:20:55 +0000 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 09 Sep 2010 15:21:08 -0400 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, Sep 09, 2010 at 02:02:46PM -0500, Brandon Casey wrote: > From: Brandon Casey > > Generally, trailing space is removed from the string matched by the > xfuncname patterns. The exception is when the matched string exceeds the > length of the fixed-size buffer that it will be copied in to. But, a > string that exceeds the buffer can still contain trailing space in the > portion of the string that will be copied into the buffer. So, simplify > this code slightly, and just perform the trailing space removal always. Hrm. So we are cutting off trailing space that might have been non-trailing space in their original string? It is hard to argue that is much worse than truncating the original string in the first place. But I really wonder whether we should be silently truncating anything, and not just dying or somehow handling this better? If I understand what is going on (and I'm not sure that I do), are we silently producing bogus word-diffs in the face of really long lines? -Peff