Date: Sat, 5 Jun 2004 00:05:00 -0700 (PDT) From: Nate Lawson <nate@root.org> To: Tim Kientzle <kientzle@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libarchive archive_read_extract.c Message-ID: <20040605000326.B54841@root.org> In-Reply-To: <20040605053115.45AE416A585@hub.freebsd.org> References: <20040605053115.45AE416A585@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040605000326.B54841>