Date: Tue, 31 Aug 1999 21:08:50 +0200 (CEST) From: Nick Hibma <hibma@skylink.it> To: "Jeffrey J. Mountin" <jeff-ml@mountin.net> Cc: John Hay <jhay@mikom.csir.co.za>, obrien@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/rm rm.1 rm.c Message-ID: <Pine.BSF.4.10.9908312107060.6750-100000@heidi.plazza.it> In-Reply-To: <3.0.3.32.19990831132028.0155c100@207.227.119.2>
next in thread | previous in thread | raw e-mail | index | archive | help
> > case FTS_DNR:
> >- if ((e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) {
> >+ if (!(e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) {
> > if (e == 0 && vflag)
> > (void)printf("%s\n", p->fts_accpath);
> > continue;
>
> I'm a neophyte to C, but surely anyone can miss the '!' when doing a quick
> review of code they are not initimate with. Certainly seen enough code to
> shudder at some practices, alibeit they are mostly located in the ports
> collection. Regardless it's not for me to judge, only suggest.
>
> Now, is the 'e=' supposed to be 'e=='?
>
> Must be -current code, so there might be a reason.
I'd like to add that
e = rmdir(p->fts_accpath);
if ( !e || (fflag && errno == ENOENT)) {
is equivalent to
if (!(e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) {
but does not hide the fact that the rmdir is executed in all cases.
Just my 15 Lire worth of comments.
Nick
--
e-Mail: hibma@skylink.it
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9908312107060.6750-100000>
