From: <suc...@us...> - 2006-07-02 00:51:08
|
Revision: 77 Author: sucknblow Date: 2006-07-01 17:50:58 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=77&view=rev Log Message: ----------- Update (-u) option now works with iriverplus2 driver on posix (used to get the tags from every file, even if the tags were already in the database). Modified Paths: -------------- trunk/frontend/easypmp/common/database.c trunk/frontend/easypmp/common/enumerate.c trunk/lib/filepath/filepath_posix.c trunk/lib/pmp_iriverplus2/ip2db.c Modified: trunk/frontend/easypmp/common/database.c =================================================================== --- trunk/frontend/easypmp/common/database.c 2006-07-01 23:03:29 UTC (rev 76) +++ trunk/frontend/easypmp/common/database.c 2006-07-02 00:50:58 UTC (rev 77) @@ -25,6 +25,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/frontend/easypmp/common/enumerate.c =================================================================== --- trunk/frontend/easypmp/common/enumerate.c 2006-07-01 23:03:29 UTC (rev 76) +++ trunk/frontend/easypmp/common/enumerate.c 2006-07-02 00:50:58 UTC (rev 77) @@ -94,6 +94,13 @@ { enumerate_dat_t ed; + // Decode the music path prefix for system path separators + ssize_t prefix_length = ucs2len(pmp->env.path_to_music.path); + ucs2char_t *music_path = alloca(sizeof(ucs2char_t) * (prefix_length + 1)); + ucs2cpy(music_path, pmp->env.path_to_music.path); + + filepath_decode(music_path); + fl->num_elements = 0; fl->elements = NULL; @@ -105,7 +112,7 @@ ed.instance = instance; return find_file( - pmp->env.path_to_music.path, + music_path, pmp->env.path_to_music.flag & PMPPEF_RECURSIVE ? 1 : 0, found_music_file, &ed Modified: trunk/lib/filepath/filepath_posix.c =================================================================== --- trunk/lib/filepath/filepath_posix.c 2006-07-01 23:03:29 UTC (rev 76) +++ trunk/lib/filepath/filepath_posix.c 2006-07-02 00:50:58 UTC (rev 77) @@ -157,9 +157,20 @@ const ucs2char_t* filepath_combinepath(ucs2char_t* dst, size_t size, const ucs2char_t* path, const ucs2char_t* file) { + size_t length = ucs2len(path); ucs2cpy(dst, path); + + // Ensure the first part ends in the path separator filepath_addslash(dst); - ucs2cat(dst, file); + + // Then strip copy the rest of the path, except any initial + // path separator. + if (*file == PATHCHAR) { + ucs2cat(dst, &(file[1])); + } else { + ucs2cat(dst, file); + } + return dst; } Modified: trunk/lib/pmp_iriverplus2/ip2db.c =================================================================== --- trunk/lib/pmp_iriverplus2/ip2db.c 2006-07-01 23:03:29 UTC (rev 76) +++ trunk/lib/pmp_iriverplus2/ip2db.c 2006-07-02 00:50:58 UTC (rev 77) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> @@ -265,6 +268,7 @@ ip2db_get_record(db, i, &src); + filepath_decode(src.pathname); length = ucs2len(path_to_root); length += ucs2len(src.pathname); length += ucs2len(src.filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |