From: <suc...@us...> - 2006-07-29 23:49:13
|
Revision: 154 Author: sucknblow Date: 2006-07-29 16:49:07 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=154&view=rev Log Message: ----------- "easypmp -ct the" should strip 'the' from 'The Proclaimers' but not 'Therapy?'. It should also strip the space. i.e. we want to see 'Proclaimers' and 'Therapy?', and not ' Proclaimers' or 'rapy?'. Fix JSPL warning which wasn't displaying when using --create. Modified Paths: -------------- trunk/ChangeLog trunk/frontend/easypmp/cui/main.c trunk/lib/gmi/gmi.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-07-29 22:06:04 UTC (rev 153) +++ trunk/ChangeLog 2006-07-29 23:49:07 UTC (rev 154) @@ -15,6 +15,7 @@ - Bug fix in string conversion with iconv. - Bug fix for stripping words such as 'the' in artist names. - Bug fix for reading playists using iriverplus2 devices. +- POSIX release now compiles on non-GNU systems, e.g. Mac OS X. - Show error messages from SpiderMonkey (JavaScript engine). - Information about copyright owners and licenses now more comprehensive. Modified: trunk/frontend/easypmp/cui/main.c =================================================================== --- trunk/frontend/easypmp/cui/main.c 2006-07-29 22:06:04 UTC (rev 153) +++ trunk/frontend/easypmp/cui/main.c 2006-07-29 23:49:07 UTC (rev 154) @@ -346,15 +346,15 @@ if (opt.verb & MODE_PLAYLIST) { // Read the database for JSPL. if ((opt.verb & MODE_PLAYLIST_JSPL) && (!records)) { -#ifdef HAVE_JSAPI_H easypmp_database_read(pmp, &opt, &records, &num_records, easypmp_progress, NULL); -#else + } +#ifndef HAVE_JSAPI_H + if(opt.verb & MODE_PLAYLIST_JSPL) { fprintf(fpe, "Warning: Ignoring -j/--jspl option. This version of easypmp\n"); fprintf(fpe, " was built without support for JavaScript playlists.\n"); + } #endif - } easypmp_playlist(&playlists, &musics, pmp, &opt, records, num_records, easypmp_progress, NULL); - } if (opt.verb & MODE_DATABASE_REPR) { database_dump(pmp, fpo, opt.repr_level); Modified: trunk/lib/gmi/gmi.c =================================================================== --- trunk/lib/gmi/gmi.c 2006-07-29 22:06:04 UTC (rev 153) +++ trunk/lib/gmi/gmi.c 2006-07-29 23:49:07 UTC (rev 154) @@ -223,10 +223,33 @@ if ((flag & GMIF_STRIP_ARTIST) && strip_words && info->artist) { int i; for (i = 0;i < num_strip_words;++i) { - if (ucs2incmp(info->artist, strip_words[i], ucs2len(strip_words[i])) == 0) { - strip_head_letters(info->artist, ucs2len(strip_words[i])); + + /* If the artist name doesn't start with this + word, then ignore it. */ + size_t length = ucs2len(strip_words[i]); + if (ucs2incmp(info->artist, strip_words[i], length) != 0) { break; } + /* OK. The artist name starts with this word. + Suppose the 'strip word' is 'the' - we + don't want to remove it if there's no + subsequent space. For example, we don't + want to strip 'The' from 'Therapy?'. + + So we need to check the next character in + the artist name for a space, remembering + that there might not actually be a next + character... + */ + size_t artist_length = ucs2len(info->artist); + if (artist_length == length) { + /* Artist name is (exactly) the word + to be stripped */ + info->artist[0] = 0; + } else if (artist_length > length && info->artist[length] == ' ') { + /* Remove the subsequent space too. */ + strip_head_letters(info->artist, length + 1); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |