git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Peter Hagervall <hager@cs.umu.se>, git@vger.kernel.org
Subject: Re: [PATCH] C version of git-count-objects
Date: Thu, 27 Apr 2006 15:39:14 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604271535460.18816@localhost.localdomain> (raw)
In-Reply-To: <7vhd4ekfu1.fsf@assigned-by-dhcp.cox.net>

On Thu, 27 Apr 2006, Junio C Hamano wrote:

> Nicolas Pitre <nico@cam.org> writes:
> 
> > On Thu, 27 Apr 2006, Peter Hagervall wrote:
> >
> >> Answering the call Linus made[1], sort of, but for a completely
> >> different program.
> >> 
> >> Anyway, it ought to be at least as portable as the shell script, and a
> >> whole lot faster, however much that matters.
> >> 
> > [...]
> >> +	for (i = 0; i < 16; i++) {
> >> +		subdir[0] = hex_digits[i];
> >> +		for (j = 0; j < 16; j++) {
> >> +			subdir[1] = hex_digits[j];
> >> +			if (access(subdir, R_OK | X_OK))
> >> +				continue;
> >> +			chdir(subdir);
> >> +			if (!(dp = opendir("."))) {
> >> +				error("can't open subdir %s", subdir);
> >> +				continue;
> >> +			}
> >
> > Looks like you're missing a chdir(".."); there.
> 
> Why would you even _need_ to chdir() anywhere, anyway?

To avoid appending the filename to the path before each lstat() I'd 
guess.


Nicolas

  reply	other threads:[~2006-04-27 19:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 10:12 [PATCH] C version of git-count-objects Peter Hagervall
2006-04-27 13:16 ` Morten Welinder
2006-04-27 13:23 ` Nicolas Pitre
2006-04-27 14:07   ` [PATCH] C version of git-count-objects, second try Peter Hagervall
2006-04-27 18:56   ` [PATCH] C version of git-count-objects Junio C Hamano
2006-04-27 19:39     ` Nicolas Pitre [this message]
2006-04-27 19:46       ` Peter Hagervall
2006-04-27 20:07         ` Linus Torvalds
2006-04-27 20:51           ` Peter Hagervall
2006-04-27 22:07             ` Junio C Hamano
2006-04-28  0:10               ` Peter Hagervall
2006-04-28  0:25                 ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0604271535460.18816@localhost.localdomain \
    --to=nico@cam.org \
    --cc=git@vger.kernel.org \
    --cc=hager@cs.umu.se \
    --cc=junkio@cox.net \
    /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.
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 NNTP newsgroup(s).