[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56618] In dir.m, if internal call to lstat fa

From: Richard
Subject: [Octave-bug-tracker] [bug #56618] In dir.m, if internal call to lstat falis, an error is thrown unnecessarily
Date: Fri, 12 Jul 2019 07:33:53 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

Follow-up Comment #4, bug #56618 (project octave):

Incidentally, there is a similar issue when there is a failed call  to 'stat'

  if (nf == 1)
    fn = flst{1};
    [st, err, msg] = stat (fn);
    if (err < 0)
      warning ("dir: 'stat (%s)' failed: %s", fn, msg);
      nf = 0;
    elseif (S_ISDIR (st.mode))
      flst = readdir (flst{1});
      nf = numel (flst);
      flst = strcat ([fn filesep], flst);

if stat fails, nf is set to zero, then later we try to do this:

info(nf,1).name = "";  # pre-declare size of struct array

which fails with an indexing error as nf is zero. We should probably not enter
the following if statement if nf == 0


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]