From owner-freebsd-arch Thu Dec 14 0: 1: 0 2000 From owner-freebsd-arch@FreeBSD.ORG Thu Dec 14 00:00:58 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from ringworld.nanolink.com (unknown [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id A740B37B400 for ; Thu, 14 Dec 2000 00:00:56 -0800 (PST) Received: (qmail 5002 invoked by uid 1000); 14 Dec 2000 08:00:07 -0000 Date: Thu, 14 Dec 2000 10:00:06 +0200 From: Peter Pentchev To: arch@FreeBSD.org Subject: Re: add -I ignoremask option to du(1) Message-ID: <20001214100006.E575@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org References: <20001214034803.C575@ringworld.oblivion.bg> <5lwvd3sfv7.fsf@assaris.sics.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5lwvd3sfv7.fsf@assaris.sics.se>; from assar@FreeBSD.ORG on Thu, Dec 14, 2000 at 06:59:08AM +0100 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Dec 14, 2000 at 06:59:08AM +0100, assar@FreeBSD.ORG wrote: > Peter Pentchev writes: > > +void > > +ignoreadd(mask) > > + char *mask; > > +{ > > + char *newmask, **newign; > > + unsigned l; > > + > > + l = strlen(mask) + 1; > > + if (newmask = (char *) malloc(l + 1), newmask == NULL) > > + err(1, "can't allocate memory"); > > + strlcpy(newmask, mask, l+1); /* strcpy? playing it safe.. */ > > Why not newmask = strdup(mask); or even do the strdup:ing below ? Ah.. my oversight, thanks! I'll submit a new diff as soon as there's some consensus on which option letter(s) should be used, and should there be an 'unignore' option, too (see my reply to David O'Brien's message in the thread). G'luck, Peter -- I've heard that this sentence is a rumor. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message