comparison src/xs_stil.c @ 648:a8ceae9ae8e3

Parse certain STIL fields bit differently.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 20 Sep 2007 19:52:05 +0000
parents dcd9d179e217
children acaba070cf49
comparison
equal deleted inserted replaced
647:3833592748eb 648:a8ceae9ae8e3
260 } 260 }
261 break; 261 break;
262 262
263 default: 263 default:
264 /* Check if we are parsing an entry */ 264 /* Check if we are parsing an entry */
265 xs_findnext(tmpLine, &linePos);
266
265 if (!tmpNode) { 267 if (!tmpNode) {
266 XS_STILDB_ERR(lineNum, tmpLine, 268 XS_STILDB_ERR(lineNum, tmpLine,
267 "Entry data encountered outside of entry or syntax error!\n"); 269 "Entry data encountered outside of entry or syntax error!\n");
268 break; 270 break;
269 } 271 }
280 XS_STILDB_MULTI; 282 XS_STILDB_MULTI;
281 g_free(tmpNode->subTunes[subEntry]->pName); 283 g_free(tmpNode->subTunes[subEntry]->pName);
282 tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]); 284 tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]);
283 } else if (strncmp(tmpLine, " TITLE:", 8) == 0) { 285 } else if (strncmp(tmpLine, " TITLE:", 8) == 0) {
284 XS_STILDB_MULTI; 286 XS_STILDB_MULTI;
285 g_free(tmpNode->subTunes[subEntry]->pTitle); 287 isMulti = TRUE;
286 tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]); 288 if (!tmpNode->subTunes[subEntry]->pTitle)
289 tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
290 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[2]);
287 } else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) { 291 } else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) {
288 XS_STILDB_MULTI; 292 XS_STILDB_MULTI;
289 g_free(tmpNode->subTunes[subEntry]->pAuthor); 293 g_free(tmpNode->subTunes[subEntry]->pAuthor);
290 tmpNode->subTunes[subEntry]->pAuthor = g_strdup(&tmpLine[9]); 294 tmpNode->subTunes[subEntry]->pAuthor = g_strdup(&tmpLine[9]);
291 } else if (strncmp(tmpLine, " ARTIST:", 8) == 0) { 295 } else if (strncmp(tmpLine, " ARTIST:", 8) == 0) {
294 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[1]); 298 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[1]);
295 } else if (strncmp(tmpLine, "COMMENT:", 8) == 0) { 299 } else if (strncmp(tmpLine, "COMMENT:", 8) == 0) {
296 XS_STILDB_MULTI; 300 XS_STILDB_MULTI;
297 isMulti = TRUE; 301 isMulti = TRUE;
298 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine); 302 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine);
299 } else if (strncmp(tmpLine, " ", 8) == 0) { 303 } else {
300 if (isMulti) { 304 if (isMulti) {
301 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[8]); 305 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), " ");
306 xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[linePos]);
302 } else { 307 } else {
303 XS_STILDB_ERR(lineNum, tmpLine, 308 XS_STILDB_ERR(lineNum, tmpLine,
304 "Entry continuation found when isMulti == FALSE.\n"); 309 "Entry continuation found when isMulti == FALSE.\n");
305 } 310 }
306 } 311 }