# HG changeset patch # User giacomo # Date 1142722084 28800 # Node ID 74576869a5060e6df46e435c24e411723c42670d # Parent bcff46a2558d1018e34b18c133d30c8f9b79e20e [svn] shortened the compare-dups-by-path function diff -r bcff46a2558d -r 74576869a506 audacious/playlist.c --- 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