git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: <git@vger.kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] common_prefix: be more careful about pathspec bounds
Date: Tue, 15 Jun 2010 15:12:29 -0700	[thread overview]
Message-ID: <7vaaqwgd2q.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <201006152004.01507.trast@student.ethz.ch> (Thomas Rast's message of "Tue\, 15 Jun 2010 20\:04\:01 +0200")

Thomas Rast <trast@student.ethz.ch> writes:
> I really didn't like the two-interleaved-loops version in your last
> mail, but this one is way more readable than even the original.
>
> (Why did you wrap the for loop? It's only 76 chars.)

Because I was writing it in my MUA ;-)

>
> Maybe you could add a comment like
>
>> 	slash = strrchr(path, '/');
>> 	if (!slash)
>> 		return 0;
> 	/* The first 'prefix' characters of 'path' always include the
> 	   trailing slash of the prefix directory */
>> 	prefix = slash - path + 1;
>
> to clean up any doubts about the correctness of the matching.

Perhaps..

  reply	other threads:[~2010-06-15 22:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 18:24 [PATCH] common_prefix: be more careful about pathspec bounds Thomas Rast
2010-06-15  8:16 ` Thomas Rast
2010-06-15  9:05   ` Johannes Schindelin
2010-06-15 15:05 ` Junio C Hamano
2010-06-15 16:06   ` Junio C Hamano
2010-06-15 18:04     ` Thomas Rast
2010-06-15 22:12       ` Junio C Hamano [this message]
2010-06-15 23:02         ` [PATCH] common_prefix: simplify and fix scanning for prefixes Thomas Rast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vaaqwgd2q.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).