cvs: pear /Image_GIS/GIS/Parser E00.php

From: Date: Mon, 05 Jan 2004 16:21:39 +0000
Subject: cvs: pear /Image_GIS/GIS/Parser E00.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-15384@lists.php.net to get a copy of this message
ostborn Mon Jan 5 11:21:39 2004 EDT Modified files: /pear/Image_GIS/GIS/Parser E00.php Log: - fixed regex for negative coords - terminate the read-loop after the end of the section Index: pear/Image_GIS/GIS/Parser/E00.php diff -u pear/Image_GIS/GIS/Parser/E00.php:1.8 pear/Image_GIS/GIS/Parser/E00.php:1.9 --- pear/Image_GIS/GIS/Parser/E00.php:1.8 Thu Jan 1 05:31:38 2004 +++ pear/Image_GIS/GIS/Parser/E00.php Mon Jan 5 11:21:39 2004 @@ -13,7 +13,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: E00.php,v 1.8 2004/01/01 10:31:38 sebastian Exp $ +// $Id: E00.php,v 1.9 2004/01/05 16:21:39 ostborn Exp $ // require_once 'Image/GIS/LineSet.php'; @@ -22,7 +22,7 @@ /** * E00 Parser. * -* @version $Revision: 1.8 $ +* @version $Revision: 1.9 $ * @since Image_GIS 1.0.0 */ class Image_GIS_Parser_E00 extends Image_GIS_Parser { @@ -64,7 +64,7 @@ } else if ($numRecords && - preg_match("#^ ([0-9]\.[0-9]{7}E[-+][0-9]{2}) ([0-9]\.[0-9]{7}E[-+][0-9]{2}) ([0-9]\.[0-9]{7}E[-+][0-9]{2}) ([0-9]\.[0-9]{7}E[-+][0-9]{2})#", $line, $a)) { + preg_match("#^[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})#", $line, $a)) { if ($this->debug) { echo $a[0] . '<br />'; } @@ -85,7 +85,7 @@ } else if ($numRecords && - preg_match("#^ ([0-9]\.[0-9]{7}E[-+][0-9]{2}) ([0-9]\.[0-9]{7}E[-+][0-9]{2})#", $line, $a)) { + preg_match("#^[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})[ -]([0-9]\.[0-9]{7}E[-+][0-9]{2})#", $line, $a)) { if ($pl['x'] != -1 && $pl['y'] != -1) { $lineSet->addLine($pl['x'], $pl['y'], $a[1], $a[2]); @@ -97,11 +97,13 @@ $numRecords--; } - else if ($this->debug && $ln > 2) { - printf( - 'Died at: %s<br />', - $ln - ); + else if ($ln > 2) { + if ($this->debug) { + printf( + 'Died at: %s<br />', + $ln + ); + } break; }

« previous php.pear.cvs (#15384) next »