Re: win32 line endings again
| From: | Steph | Date: | Sat, 17 Sep 2005 14:19:35 +0000 |
| Subject: | Re: win32 line endings again | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1654@lists.php.net to get a copy of this message | ||
Hiya Tom,
I'm totally confused as to why we're seeing different behaviour under the
same plaform, but it's not the first time you've mentioned this.
It'll need an OS check...
- Steph
----- Original Message -----
From: "Tom Rogers" <trogers@kwikin.com>
To: "PHP-GTK dev" <php-gtk-dev@lists.php.net>
Sent: Saturday, September 17, 2005 6:37 AM
Subject: [PHP-GTK-DEV] win32 line endings again
> Hi
>
> I just did a completely new checkout and came across a problem with
> windows line endings again in the generator scripts. This patch fixes
> the problem.
>
>
> diff -u -w -b -r1.28 override.php
> --- override.php 4 Sep 2005 06:02:27 -0000 1.28
> +++ override.php 17 Sep 2005 05:35:30 -0000
> @@ -92,9 +92,11 @@
>
> function _parse_block($block, $blocklineno, $file_name)
> {
> - if (strpos($block, "\n"))
> - list($line, $rest) = explode("\n", $block, 2);
> - else {
> + if (strpos($block, "\n")) {
> + $test = preg_split('/\r\n|\n/',ltrim($block));
> + $line = array_shift($test);
> + $rest = implode("\n",$test);
> + } else {
> $line = $block;
> $rest = '';
> }
>
> --
>
> Tom
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>