From: H.Merijn Brand Date: Mon, 11 Feb 2008 10:17:41 GMT Subject: Re: read_branches_file () Message-ID: <20080211111741.2269f89b@pc09.procura.nl> In-Reply-To: <47B01CD4.4040004@op5.se> On Mon, 11 Feb 2008 11:00:52 +0100, Andreas Ericsson wrote: > H.Merijn Brand wrote: > > - if (!f) > > + if (stat (gp, &st_buf) || S_ISDIR (st_buf.st_mode)) > > Shouldn't this be > if (stat(gp, &st_buf) || !S_ISREG(st_buf.st_mode)) Yes, see several follow-ups in this thread. > ? > > Otherwise, you might end up opening a FIFO, a socket or a > block/char special, which is obviously undesired. At the moment of the patch I was unsure if these were supported :) At least FIFO's and character devices are less error-prone than DIR's -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/