changeset 648:a8ceae9ae8e3

Parse certain STIL fields bit differently.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 20 Sep 2007 19:52:05 +0000
parents 3833592748eb
children 7de614ecb7b6
files src/xs_stil.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xs_stil.c	Wed Sep 05 19:44:05 2007 +0000
+++ b/src/xs_stil.c	Thu Sep 20 19:52:05 2007 +0000
@@ -262,6 +262,8 @@
 
 		default:
 			/* Check if we are parsing an entry */
+			xs_findnext(tmpLine, &linePos);
+			
 			if (!tmpNode) {
 				XS_STILDB_ERR(lineNum, tmpLine,
 					"Entry data encountered outside of entry or syntax error!\n");
@@ -282,8 +284,10 @@
 				tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]);
 			} else if (strncmp(tmpLine, "  TITLE:", 8) == 0) {
 				XS_STILDB_MULTI;
-				g_free(tmpNode->subTunes[subEntry]->pTitle);
-				tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
+				isMulti = TRUE;
+				if (!tmpNode->subTunes[subEntry]->pTitle)
+					tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
+				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[2]);
 			} else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) {
 				XS_STILDB_MULTI;
 				g_free(tmpNode->subTunes[subEntry]->pAuthor);
@@ -296,9 +300,10 @@
 				XS_STILDB_MULTI;
 				isMulti = TRUE;
 				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine);
-			} else if (strncmp(tmpLine, "        ", 8) == 0) {
+			} else {
 				if (isMulti) {
-					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[8]);
+					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), " ");
+					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[linePos]);
 				} else {
 					XS_STILDB_ERR(lineNum, tmpLine,
 					"Entry continuation found when isMulti == FALSE.\n");