Mercurial > audlegacy
changeset 853:74576869a506 trunk
[svn] shortened the compare-dups-by-path function
author | giacomo |
---|---|
date | Sat, 18 Mar 2006 14:48:04 -0800 |
parents | bcff46a2558d |
children | 61e7332e0652 |
files | audacious/playlist.c |
diffstat | 1 files changed, 2 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/audacious/playlist.c Sat Mar 18 14:31:38 2006 -0800 +++ b/audacious/playlist.c Sat Mar 18 14:48:04 2006 -0800 @@ -2264,27 +2264,8 @@ static gint playlist_dupscmp_path( const PlaylistEntry * a , const PlaylistEntry * b ) { - gchar *a_filename = a->filename, *b_filename = b->filename; - gchar *posa, *posb; - gint len, ret; - - posa = strrchr(a_filename, '/'); - posb = strrchr(b_filename, '/'); - - /* sort directories before files */ - if (posa && posb && (posa - a_filename != posb - b_filename)) { - if (posa -a_filename > posb - b_filename) { - len = posb - b_filename; - ret = -1; - } - else { - len = posa - a_filename; - ret = 1; - } - if (!strncmp(a_filename, b_filename, len)) - return ret; - } - return strcmp(a_filename, b_filename); + /* simply compare the entire filename string */ + return strcmp(a->filename, b->filename); } void