Mercurial > audlegacy-plugins
changeset 1755:f503db6acf72
Changed STIL parsing of some entries.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 20 Sep 2007 23:10:58 +0300 |
parents | 3d4a09dbaa17 |
children | 44ef6bf0ab30 |
files | src/sid/xs_stil.c |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sid/xs_stil.c Wed Sep 19 17:48:12 2007 +0300 +++ b/src/sid/xs_stil.c Thu Sep 20 23:10:58 2007 +0300 @@ -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");