From owner-cvs-all@FreeBSD.ORG Sat Jun 5 00:05:34 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EF0316A4CE for ; Sat, 5 Jun 2004 00:05:34 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 2998843D54 for ; Sat, 5 Jun 2004 00:05:19 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 54894 invoked by uid 1000); 5 Jun 2004 07:05:00 -0000 Date: Sat, 5 Jun 2004 00:05:00 -0700 (PDT) From: Nate Lawson To: Tim Kientzle In-Reply-To: <20040605053115.45AE416A585@hub.freebsd.org> Message-ID: <20040605000326.B54841@root.org> References: <20040605053115.45AE416A585@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libarchive archive_read_extract.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2004 07:05:34 -0000 On Fri, 4 Jun 2004, Tim Kientzle wrote: > kientzle 2004/06/04 22:30:41 PDT > > FreeBSD src repository > > Modified files: > lib/libarchive archive_read_extract.c > Log: > Recognize when we've accidentally created "foo/." > and don't complain about it. > > Revision Changes Path > 1.15 +12 -0 src/lib/libarchive/archive_read_extract.c > > --- src/lib/libarchive/archive_read_extract.c:1.14 Thu Jun 3 16:29:47 2004 > +++ src/lib/libarchive/archive_read_extract.c Fri Jun 4 22:30:41 2004 > @@ -501,6 +501,18 @@ > /* Doesn't exist: missing parent dir? */ > mkdirpath(a, name); > if (mkdir(name, mode) == 0) > + return (ARCHIVE_OK); > + /* > + * Yes, people really do type "tar -cf - foo/." for > + * reasons that I cannot fathom. When they do, the > + * dir "foo" gets created in mkdirpath() and the > + * mkdir("foo/.") just above still fails. So, I've > + * added yet another check here to catch this > + * particular case. That's what tab completion in tcsh does. > + * > + * There must be a better way ... > + */ > + if (stat(name, &st) == 0 && S_ISDIR(st.st_mode)) ^^^^^^^ Double spaces. -Nate