Re: win32 line endings again
| From: | Steph | Date: | Sat, 17 Sep 2005 14:27:47 +0000 |
| Subject: | Re: win32 line endings again | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1655@lists.php.net to get a copy of this message | ||
Aha, got it! You're copying files across and producing win32 line endings
in the process, no? The original files are in CVS with Unix line endings,
and _should_ be checked out that way... but I can see how that might fail,
one way or another. The Tortoise CVS client provides win32 line endings by
default too.
OK, so that eventuality still needs accounting for. Not an OS check then, a
check for the existence of \r\n.
- Steph
----- Original Message -----
From: "Steph" <steph@zend.com>
To: "Tom Rogers" <trogers@kwikin.com>; "PHP-GTK dev"
<php-gtk-dev@lists.php.net>
Sent: Saturday, September 17, 2005 3:19 PM
Subject: Re: [PHP-GTK-DEV] win32 line endings again
> 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
> >
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>