From mboxrd@z Thu Jan 1 00:00:00 1970 From: Duy Nguyen Subject: Re: [PATCH] clone: allow cloning local paths with colons in them Date: Sun, 28 Apr 2013 09:15:04 +0700 Message-ID: References: <20130422153516.GB11886@sigill.intra.peff.net> <1367033778-13923-1-git-send-email-pclouds@gmail.com> <7vip37u11a.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Junio C Hamano , Git Mailing List , Jeff King , Jonathan Niedier , William Giokas <1007380@gmail.com>, fsckdaemon@gmail.com, Daniel Barkalow To: Eric Sunshine X-From: git-owner@vger.kernel.org Sun Apr 28 04:15:53 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 1UWH9a-0006K2-IU for gcvg-git-2@plane.gmane.org; Sun, 28 Apr 2013 04:15:50 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755738Ab3D1CPf (ORCPT ); Sat, 27 Apr 2013 22:15:35 -0400 Received: from mail-oa0-f53.google.com ([209.85.219.53]:50447 "EHLO mail-oa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753758Ab3D1CPe (ORCPT ); Sat, 27 Apr 2013 22:15:34 -0400 Received: by mail-oa0-f53.google.com with SMTP id m6so5004270oag.40 for ; Sat, 27 Apr 2013 19:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=s2Il1r6zmdeTsVSyOXkBW92MB21Kfg2fncni3Mb7KAU=; b=ms86z1RnvbNKYXHv35VSbMHdWvoOOs0ZTBZYs1l6Uh506LvonxtPkZrnw3SHux45Hv OqXvRdzUTEU11yqthIUUaeL+qtDSYkjssXKfvtnFj8voIbZU8OgcqEwG4/kkl2NNjCbQ IqXiroj12pMjDEQ7lXWLdykuKi70IkZ5v3HaVZORMShQWYeY2DSflb4S6xfA2Lk854PX yBhwsz6BBvBFxZ7zPmJIQXMVK6nCQSq7ni9R6+SZXNoclejWeXU/IKTkn1HThsqXZ2Cw Q9JmlRmDcTIB4paaNdmmrm9LUfmDG++Hc3O5uspDB6ufrP+VPoh4orH+0Zlfb1wNVb75 mh5A== X-Received: by 10.60.65.68 with SMTP id v4mr21625326oes.13.1367115334445; Sat, 27 Apr 2013 19:15:34 -0700 (PDT) Received: by 10.76.180.138 with HTTP; Sat, 27 Apr 2013 19:15:04 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Sun, Apr 28, 2013 at 8:48 AM, Eric Sunshine wrote: > On Sat, Apr 27, 2013 at 8:19 PM, Duy Nguyen wrote: >> On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano wrote: >>> That was fairly hard to grok. Is that equivalent to this? >>> >>> if (c == ':' && path < strchrnul(host, '/')) { >>> /* is the first slash past the colon? */ >>> protocol = PROTO_SSH; >>> *path++ = '\0'; >>> } else { >>> path = end; >>> } >>> >> >> The original code is already hard to grok so I may be mistaken here. >> But I think it's not the same. For the case when c == '/', it will do >> "path = end;", which is unintended. It should keep the current "path" >> value (i.e. == strchr(end, '/')). The use of "strchrnul(host, '/')" is >> good though. > > Do you want to take Windows '\' into account also? Windows path does not allow ':' so it's a non-issue in the first place. -- Duy