changeset 7608:e1962f1bb326

Skip html tags (like <i>) inside subviewer subtitles.
author atmos4
date Sun, 06 Oct 2002 00:46:47 +0000
parents 8d73a0292932
children 2ac457fb9c8c
files subreader.c
diffstat 1 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Sun Oct 06 00:22:32 2002 +0000
+++ b/subreader.c	Sun Oct 06 00:46:47 2002 +0000
@@ -239,9 +239,28 @@
 	    len=0;
 	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++);
 	    if (len) {
-		current->text[i]=(char *)malloc (len+1);
+                int j=0,skip=0;
+		char *curptr=current->text[i]=(char *)malloc (len+1);
 		if (!current->text[i]) return ERR;
-		strncpy (current->text[i], line, len); current->text[i][len]='\0';
+		//strncpy (current->text[i], line, len); current->text[i][len]='\0';
+                for(j; j<len; j++) {
+		    /* let's filter html tags ::atmos */
+		    if(line[j]=='>') {
+			skip=0;
+			continue;
+		    }
+		    if(line[j]=='<') {
+			skip=1;
+			continue;
+		    }
+		    if(skip) {
+			continue;
+		    }
+		    *curptr=line[j];
+		    curptr++;
+		}
+		*curptr='\0';
+
 		i++;
 	    } else {
 		break;