Skip to content
Snippets Groups Projects
Commit 32a535d6 authored by yorhel's avatar yorhel
Browse files

* 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
parent 2202762f
No related branches found
No related tags found
No related merge requests found
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
......
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... */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment