[Mplayer-cvslog] CVS: main subreader.c,1.34,1.35

Atmosfear atmos4 at mplayer.dev.hu
Sun Nov 11 16:41:19 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv19617

Modified Files:
	subreader.c 
Log Message:
Applied SAMI patch by Evgeny Chukreev <codedj at echo dot ru>


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- subreader.c	26 Oct 2001 22:14:19 -0000	1.34
+++ subreader.c	11 Nov 2001 15:41:17 -0000	1.35
@@ -89,16 +89,21 @@
  
 	case 3: /* get all text until '<' appears */
 	    if (*s == '\0') { break; }
-	    else if (*s == '<') { state = 4; }
-	    else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
-	    else if (*s == '\r') { s++; }
-	    else if (!strncasecmp (s, "<br>", 4) || *s == '\n') {
+	    else if (!strncasecmp (s, "<br>", 4)) {
 		*p = '\0'; p = text; trail_space (text);
 		if (text[0] != '\0')
 		    current->text[current->lines++] = strdup (text);
-		if (*s == '\n') s++; else s += 4;
+		s += 4;
 	    }
+	    else if (*s == '<') { state = 4; }
+	    else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
+	    else if (*s == '\t') { *p++ = ' '; s++; }
+	    else if (*s == '\r' || *s == '\n') { s++; }
 	    else *p++ = *s++;
+
+	    /* skip duplicated space */
+	    if (p > text + 2) if (*(p-1) == ' ' && *(p-2) == ' ') p--;
+	    
 	    continue;
 
 	case 4: /* get current->end or skip <TAG> */




More information about the MPlayer-cvslog mailing list