bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] ls: don't use an undefined struct stat after failed stat/lst


From: Jim Meyering
Subject: Re: [PATCH] ls: don't use an undefined struct stat after failed stat/lstat
Date: Tue, 29 Sep 2009 14:00:07 +0200

Eric Blake wrote:

> According to Jim Meyering on 9/29/2009 5:13 AM:
>> -          /* The failed stat/lstat may have modified f->stat.  Clear it,
>> -             since we may use at least its st_ino member, e.g.,
>> -             when trying to print the inode of dangling symlink:
>> -             mkdir d; ln -s no-such d/s; ls -Li d  */
>> -          memset (&f->stat, 0, sizeof (f->stat));
>> +          f->stat.st_ino = 22;
>
> Why 22?  Is this debugging leftovers?

haha, yes.  Thanks ;-)




reply via email to

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