mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
* When changing sort order to size, automatically sort in descending order
* Removed unused and hidden feature to sort on number of files * When sorting on size, and multiple items have the same size, sort them on filename * Updated changelog git-svn-id: svn://blicky.net/ncdu/trunk@8 ce56bc8d-f834-0410-b703-f827bd498a76
This commit is contained in:
parent
2202762f0a
commit
32a535d6d7
4 changed files with 17 additions and 9 deletions
|
|
@ -1,6 +1,10 @@
|
|||
1.2 - ?
|
||||
1.2 - 2007-07-24
|
||||
- Fixed some bugs on cygwin
|
||||
- Added du-like exclude patterns
|
||||
- Fixed bug #1758403: large directories work fine now
|
||||
- Rewrote a large part of the code
|
||||
- Fixed a bug with wide characters
|
||||
- Performance improvements when browsing large dirs
|
||||
|
||||
1.1 - 2007-04-30
|
||||
- Deleting files and directories is now possible from
|
||||
|
|
|
|||
6
NEWS
6
NEWS
|
|
@ -1,6 +1,10 @@
|
|||
1.2 - ?
|
||||
1.2 - 2007-07-24
|
||||
- Fixed some bugs on cygwin
|
||||
- Added du-like exclude patterns
|
||||
- Fixed bug #1758403: large directories work fine now
|
||||
- Rewrote a large part of the code
|
||||
- Fixed a bug with wide characters
|
||||
- Performance improvements when browsing large dirs
|
||||
|
||||
1.1 - 2007-04-30
|
||||
- Deleting files and directories is now possible from
|
||||
|
|
|
|||
|
|
@ -48,15 +48,16 @@ int cmp(struct dir *x, struct dir *y) {
|
|||
b = y; a = x;
|
||||
}
|
||||
if(!(bflags & BF_NDIRF) && y->flags & FF_DIR && !(x->flags & FF_DIR))
|
||||
r = 1;
|
||||
else if(!(bflags & BF_NDIRF) && !(y->flags & FF_DIR) && x->flags & FF_DIR)
|
||||
r = -1;
|
||||
else if(bflags & BF_NAME)
|
||||
return(1);
|
||||
if(!(bflags & BF_NDIRF) && !(y->flags & FF_DIR) && x->flags & FF_DIR)
|
||||
return(-1);
|
||||
|
||||
if(bflags & BF_NAME)
|
||||
r = strcmp(a->name, b->name);
|
||||
else if(bflags & BF_FILES)
|
||||
r = (a->files - b->files);
|
||||
if(r == 0)
|
||||
r = a->size > b->size ? 1 : (a->size == b->size ? 0 : -1);
|
||||
if(r == 0)
|
||||
r = strcmp(a->name, b->name);
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@
|
|||
/* Browse Flags (int bflags) */
|
||||
#define BF_NAME 1
|
||||
#define BF_SIZE 2
|
||||
#define BF_FILES 4
|
||||
#define BF_NDIRF 32 /* Normally, dirs before files, setting this disables it */
|
||||
#define BF_DESC 64
|
||||
#define BF_HIDE 128 /* don't show hidden files... */
|
||||
|
|
|
|||
Loading…
Reference in a new issue