# HG changeset patch # User Matti Hamalainen # Date 1190317925 0 # Node ID a8ceae9ae8e39f9348b4aa64d66cb89568e7f963 # Parent 3833592748eb46824f8b65f430b02c27b86f5300 Parse certain STIL fields bit differently. diff -r 3833592748eb -r a8ceae9ae8e3 src/xs_stil.c --- 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");