[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

CR-LF support lacking for formats



This is needed for formats to work right when the lineends are from
dosland.


Sarathy
gsar@ActiveState.com
-----------------------------------8<-----------------------------------
Change 4738 by gsar@rake on 1999/12/30 04:36:12

	CR-LF support broken for formats

Affected files ...

... //depot/perl/toke.c#175 edit

Differences ...

==== //depot/perl/toke.c#175 (text) ====
Index: perl/toke.c
--- perl/toke.c.~1~	Wed Jan  5 11:23:37 2000
+++ perl/toke.c	Wed Jan  5 11:23:37 2000
@@ -6894,6 +6894,14 @@
 		    needargs = TRUE;
 	    }
 	    sv_catpvn(stuff, s, eol-s);
+#ifndef PERL_STRICT_CR
+	    if (eol-s > 1 && eol[-2] == '\r' && eol[-1] == '\n') {
+		char *end = SvPVX(stuff) + SvCUR(stuff);
+		end[-2] = '\n';
+		end[-1] = '\0';
+		SvCUR(stuff)--;
+	    }
+#endif
 	}
 	s = eol;
 	if (PL_rsfp) {
End of Patch.


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]