Properly reset XML scanner state between scans

Fix indexing of multiple XML files by resetting path_found for each
XML file.
This commit is contained in:
Neil Spring 2009-04-02 13:10:19 +02:00 committed by Julien BLACHE
parent 54d441f57c
commit 7565b02229

View File

@ -183,8 +183,9 @@ int scan_xml_is_file(char *path) {
* @param ppnew where the real physical path goes
* @returns 1 on success, 0 on failure
*/
static int path_found = 0;
int scan_xml_translate_path(char *pold, char *pnew) {
static int path_found=0;
static int discard;
char base_path[PATH_MAX];
char working_path[PATH_MAX];
@ -423,6 +424,8 @@ int scan_xml_playlist(char *filename) {
MAYBEFREE(scan_xml_real_base_path);
scan_xml_file = filename;
/* reinitialize path_found for scan_xml_translate_path() */
path_found = 0;
/* initialize the redblack tree */
if((scan_xml_db = rbinit(scan_xml_rb_compare,NULL)) == NULL) {