[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Now 100% Serious Newline conversion suggestion

From: Mark Benedetto King <bking_at_answerfriend.com>
Date: 2001-12-14 15:48:50 CET

> My nice cross-platform perl script that used to do
>
> checkout("foo");
> process("foo");
>
> becomes
>
> checkout("foo");
> $foo_ending = get_line_ending_attribute("foo");
> $platform_ending = get_platform_line_ending();
> if ($foo_ending == CRLF && $platform_ending == LF) {
> dos_to_unix("foo");
> } else if ($foo_ending == LF && $platform_ending == CRLF) {
> unix_to_dos("foo");
> if ($foo_ending == CR && $platform_ending == LF) {
> mac_to_unix("foo");
> } else if ($foo_ending == LF && $platform_ending == CR) {
> unix_to_mac("foo");
> if ($foo_ending == CR && $platform_ending == CRLF) {
> mac_to_dos("foo");
> } else if ($foo_ending == CRLF && $platform_ending == CR) {
> unix_to_mac("foo");
> }
> process("foo");
>
> No thanks.
>
> Peter.
>
>

consider:

      checkout("foo");
      $foo_ending = get_line_ending_attribute("foo");
      $platform_ending = get_platform_line_ending();
      fix_endings( "foo", $foo_ending, $platform_ending );

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:53 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.