bug-findutils
[Top][All Lists]
Advanced

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

[bug #31172] find -size -1M returns only files with zero length


From: Pavel Shuvalov
Subject: [bug #31172] find -size -1M returns only files with zero length
Date: Thu, 30 Sep 2010 12:43:55 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.10) Gecko/20100915 Ubuntu/10.04 (lucid) Firefox/3.6.10

URL:
  <http://savannah.gnu.org/bugs/?31172>

                 Summary: find -size -1M returns only files with zero length
                 Project: findutils
            Submitted by: shuvalov
            Submitted on: Thu 30 Sep 2010 12:43:54 PM GMT
                Category: find
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.5.9
           Fixed Release: None

    _______________________________________________________

Details:

I've found a bug with `-size -1M` option. Actually it returns only files with
zero length. I think the reason is in pred_size code (pred.c):


f_val = ((stat_buf->st_size / pred_ptr->args.size.blocksize)
       + (stat_buf->st_size % pred_ptr->args.size.blocksize != 0));

case COMP_LT:
      if (f_val < pred_ptr->args.size.size)

f_val will be equal to 1 for all files with a size in range (0, 1M) and
(f_val < pred_ptr->args.size.size) will be false for such files.







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31172>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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