git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: "Ismail Dönmez" <ismail@pardus.org.tr>,
	"Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [ANNOUNCE] GIT 1.5.4-rc3
Date: Sat, 12 Jan 2008 17:57:49 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.1.00.0801121756400.8333@wbgn129.biozentrum.uni-wuerzburg.de> (raw)
In-Reply-To: <20080112090432.GA6134@coredump.intra.peff.net>

Hi,

On Sat, 12 Jan 2008, Jeff King wrote:

> diff --git a/builtin-clean.c b/builtin-clean.c
> index 6cad8ea..eb853a3 100644
> --- a/builtin-clean.c
> +++ b/builtin-clean.c
> @@ -90,7 +90,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  	strbuf_init(&directory, 0);
>  
>  	if (pathspec)
> -		seen = xmalloc(argc);
> +		seen = xmalloc(argc > 0 ? argc : 1);
>  
>  	for (i = 0; i < dir.nr; i++) {
>  		struct dir_entry *ent = dir.entries[i];
> @@ -125,7 +125,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  			continue;
>  
>  		if (pathspec) {
> -			memset(seen, 0, argc);
> +			memset(seen, 0, argc > 0 ? argc : 1);
>  			matches = match_pathspec(pathspec, ent->name, ent->len,
>  						 baselen, seen);
>  		} else {

Would it not be better to guard the memset by an "if (argc)", and set 
"seen" to NULL by default?

Ciao,
Dscho

  parent reply	other threads:[~2008-01-12 16:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  7:11 [ANNOUNCE] GIT 1.5.4-rc3 Junio C Hamano
2008-01-12  7:26 ` Ismail Dönmez
2008-01-12  7:34   ` Junio C Hamano
2008-01-12  7:47     ` Ismail Dönmez
2008-01-12  8:04       ` Junio C Hamano
2008-01-12  9:04       ` Jeff King
2008-01-12  9:05         ` Jeff King
2008-01-12 11:10         ` valgrind test script integration Jeff King
2008-01-12 11:36           ` Jeff King
2008-01-12 17:10             ` Johannes Schindelin
2008-01-12 18:12               ` Jeff King
2008-01-12 13:01         ` [ANNOUNCE] GIT 1.5.4-rc3 René Scharfe
2008-01-12 13:10         ` Ismail Dönmez
2008-01-12 16:57         ` Johannes Schindelin [this message]
2008-01-12 18:09           ` Jeff King
2008-01-12 19:09         ` Junio C Hamano
2008-01-12 14:24 ` Roger C. Soares
2008-01-12 19:13   ` Junio C Hamano
     [not found] ` <7vsl13wmas.fsf-jO8aZxhGsIagbBziECNbOZn29agUkmeCHZ5vskTnxNA@public.gmane.org>
2008-01-13 14:41   ` Steffen Prohaska
2008-01-21  2:37 ` [ANNOUNCE] GIT 1.5.4-rc4 Junio C Hamano
     [not found]   ` <7vsl0r3nvc.fsf-jO8aZxhGsIagbBziECNbOZn29agUkmeCHZ5vskTnxNA@public.gmane.org>
2008-01-21 22:22     ` Steffen Prohaska
     [not found]       ` <BB330DC7-9F38-4D41-85A2-D475701B6083-wjoc1KHpMeg@public.gmane.org>
2008-01-22  1:21         ` Johannes Schindelin
     [not found]           ` <alpine.LSU.1.00.0801220121300.5731-OGWIkrnhIhzN0uC3ymp8PA@public.gmane.org>
2008-01-22  5:50             ` Steffen Prohaska
2008-01-28 10:56   ` [ANNOUNCE] GIT 1.5.4-rc5 Junio C Hamano
2008-01-28 18:38     ` Jeff King
2008-01-29  0:36       ` Gustaf Hendeby
2008-01-29  1:25       ` Junio C Hamano
2008-01-29  1:29         ` Jeff King
2008-01-29  6:06     ` Steffen Prohaska

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=alpine.LSU.1.00.0801121756400.8333@wbgn129.biozentrum.uni-wuerzburg.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ismail@pardus.org.tr \
    --cc=peff@peff.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.
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).