windrobin / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Support unix linefeeds in .ASE parser #215

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The ASE parser in src/org/papervision3d/objects/parsers/Ase.as (rev 919)
assumes MS-DOS linefeeds ("\r\n"), but in some cases .ase files may have
unix linefeeds (for example when passing through email improperly). The
attached patch changes the linefeed splitter to use a regexp that accepts
both MS-DOS and UNIX linefeeds ("\r\n" or "\n").

Original issue reported on code.google.com by postmes...@gmail.com on 7 Aug 2009 at 12:54

Attachments:

GoogleCodeExporter commented 9 years ago
For easy review, here is the text contents of the attached patch:

Index: src/org/papervision3d/objects/parsers/Ase.as
===================================================================
--- src/org/papervision3d/objects/parsers/Ase.as    (revision 919)
+++ src/org/papervision3d/objects/parsers/Ase.as    (working copy)
@@ -109,7 +109,7 @@
            var faces    :Array = this.geometry.faces = new Array();

            var loader:URLLoader = URLLoader(e.target);
-           var lines: Array = unescape(loader.data).split( '\r\n' );
+           var lines: Array = unescape(loader.data).split( /\r?\n/ );

            var line: String;
            var chunk: String;

Original comment by postmes...@gmail.com on 7 Aug 2009 at 12:54

GoogleCodeExporter commented 9 years ago
Also I'm unsure if the unescape() should be there at all.

Original comment by postmes...@gmail.com on 7 Aug 2009 at 12:57