changeset 6657:766b6fb28ebf

subrip sometimes uses pipe as newline separator - patch by MOLNAR Andor <dolphy@inf.elte.hu>
author arpi
date Sat, 06 Jul 2002 15:19:08 +0000
parents 92b29c3ed0c0
children 64cf429bd7eb
files subreader.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Sat Jul 06 15:17:27 2002 +0000
+++ b/subreader.c	Sat Jul 06 15:19:08 2002 +0000
@@ -212,13 +212,14 @@
 
 	p=q=line;
 	for (current->lines=1; current->lines < SUB_MAX_TEXT; current->lines++) {
-	    for (q=p,len=0; *p && *p!='\r' && *p!='\n' && strncmp(p,"[br]",4); p++,len++);
+	    for (q=p,len=0; *p && *p!='\r' && *p!='\n' && *p!='|' && strncmp(p,"[br]",4); p++,len++);
 	    current->text[current->lines-1]=(char *)malloc (len+1);
 	    if (!current->text[current->lines-1]) return ERR;
 	    strncpy (current->text[current->lines-1], q, len);
 	    current->text[current->lines-1][len]='\0';
 	    if (!*p || *p=='\r' || *p=='\n') break;
-	    while (*p++!=']');
+	    if (*p=='|') p++;
+	    else while (*p++!=']');
 	}
 	break;
     }