bugfindutils - Bugs: bug #31172, find -size -1M returns only files...

 
 

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

Submitted by:  Pavel Shuvalov <shuvalov>
Submitted on:  Thu 30 Sep 2010 12:43:54 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Duplicate
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.5.9Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 30 Sep 2010 02:08:43 PM UTC, comment #1:

Duplicate of https://savannah.gnu.org/bugs/?12162

Eric Blake <ericb>
Project Administrator
Thu 30 Sep 2010 12:43:54 PM UTC, original submission:

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.

Pavel Shuvalov <shuvalov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ericb (Posted a comment)
  • -unavailable- added by shuvalov (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Sep 2010 02:08:43 PM UTCericbStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1