From 7565b022295a4def6426b95cb8673a5a0b975759 Mon Sep 17 00:00:00 2001 From: Neil Spring Date: Thu, 2 Apr 2009 13:10:19 +0200 Subject: [PATCH] Properly reset XML scanner state between scans Fix indexing of multiple XML files by resetting path_found for each XML file. --- src/scan-xml.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scan-xml.c b/src/scan-xml.c index 2fee2dcf..42220d1c 100644 --- a/src/scan-xml.c +++ b/src/scan-xml.c @@ -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) {