[svn:parrot] r46054 - trunk/runtime/parrot/library/ProfTest

fperrad at svn.parrot.org fperrad at svn.parrot.org
Tue Apr 27 09:09:06 UTC 2010


Author: fperrad
Date: Tue Apr 27 09:09:06 2010
New Revision: 46054
URL: https://trac.parrot.org/parrot/changeset/46054

Log:
[prof] fix on Windows ( newline \r\n )

Modified:
   trunk/runtime/parrot/library/ProfTest/PIRProfile.nqp

Modified: trunk/runtime/parrot/library/ProfTest/PIRProfile.nqp
==============================================================================
--- trunk/runtime/parrot/library/ProfTest/PIRProfile.nqp	Tue Apr 27 08:37:11 2010	(r46053)
+++ trunk/runtime/parrot/library/ProfTest/PIRProfile.nqp	Tue Apr 27 09:09:06 2010	(r46054)
@@ -17,8 +17,9 @@
 }
 
 method build_profile_array() {
-
-    my @pprof_lines := pir::split("\n", self<profile>);
+    my %config := self.get_config();
+    my $newline := %config<win32> ?? "\r\n" !! "\n";
+    my @pprof_lines := pir::split($newline, self<profile>);
     self<profile_array> := ();
 
     for @pprof_lines -> $line {
@@ -34,7 +35,7 @@
     my %line_hash := {};
 
     my $colon_idx := pir::index($line, ":");
-    #if the line starts with "VERSION, CLI or END_OF_RUNLOOP, 
+    #if the line starts with "VERSION, CLI or END_OF_RUNLOOP,
     if ($colon_idx >= 3) {
         my $type := pir::substr($line, 0, $colon_idx);
         my $data := pir::substr($line, $colon_idx+1);


More information about the parrot-commits mailing list