You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Justin Erenkrantz <ju...@erenkrantz.com> on 2004/07/22 18:17:25 UTC

Line-endings in libsvn_diff was Re: OS/2 port, working through the tests

--On Wednesday, July 21, 2004 9:08 PM +1000 Brian Havard 
<br...@kheldar.apana.org.au> wrote:

> Hi all,
>   I've got the current 1.1 code to build & run on OS/2 and thought it might
> be nice if it passed the test suit. I haven't built with BDB so I did a
> "make fsfscheck" and the first failures I hit were

Cool!  Any patches needed for it to build?

> I found the first was a line end problem (OS/2 uses DOS style CR/LF) as
> making changes like the diff below makes the test pass. So which is wrong,
> the test or the library?

I think it's the test in this particular situation.  I think all of the 
'output' in the tests should be terminated with APR_EOL_STR as diff outputs 
the line encoding of the host OS not what's in the file, IIRC.

Yet, if that's the case, I'm wondering how it passes on Win32 then as it 
should have the same problem.  Sander?  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Line-endings in libsvn_diff was Re: OS/2 port, working through the tests

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Sat, 24 Jul 2004 10:23:29 +0200, Sander Striker wrote:

>> From: Brian Havard [mailto:brianh@kheldar.apana.org.au] 
>> 
>> So is there any good reason why libsvn_diff always outputs LF 
>> for eol rather than the APR_EOL_STR?
>
>Nope.  I was under the impression that I already fixed this,
>but apparently not.

There are a number of XXX comments in diff_file.c describing unresolved
issues involving line endings. This appears in 3 places:

  /* XXX: '\n' doesn't really cut it.  We need to be able to detect
   * XXX: '\n', '\r' and '\r\n'.
   */

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Line-endings in libsvn_diff was Re: OS/2 port, working through the tests

Posted by Sander Striker <st...@apache.org>.
> From: Brian Havard [mailto:brianh@kheldar.apana.org.au] 
> Sent: Saturday, July 24, 2004 9:34 AM

> On Sat, 24 Jul 2004 14:23:15 +1000 (EST), Brian Havard wrote:
> 
> >On Thu, 22 Jul 2004 11:17:25 -0700, Justin Erenkrantz wrote:
> >
> >>--On Wednesday, July 21, 2004 9:08 PM +1000 Brian Havard 
> >><br...@kheldar.apana.org.au> wrote:
> 
> >>> I found the first was a line end problem (OS/2 uses DOS 
> style CR/LF) 
> >>> as making changes like the diff below makes the test 
> pass. So which 
> >>> is wrong, the test or the library?
> >>
> >>I think it's the test in this particular situation.  I think all of 
> >>the 'output' in the tests should be terminated with APR_EOL_STR as 
> >>diff outputs the line encoding of the host OS not what's in 
> the file, IIRC.
> >>
> >>Yet, if that's the case, I'm wondering how it passes on 
> Win32 then as 
> >>it should have the same problem.  Sander?  -- justin
> >
> >That's what I suspected but I also wondered how/if it passed 
> on windows.
> 
> Actually, it turns out that I'd made a change to the diff 
> code to make it output the right eol characters. If I remove 
> that change the tests pass but diff output to the console is 
> screwed up. The OS/2 console responds to a LF character 
> literally, moving down a line but not resetting the column so 
> output looks like:
> 
> line1
>      line2
>           line3
> etc.
> 
> So is there any good reason why libsvn_diff always outputs LF 
> for eol rather than the APR_EOL_STR?

Nope.  I was under the impression that I already fixed this,
but apparently not.

Sander


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Line-endings in libsvn_diff was Re: OS/2 port, working through the tests

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Sat, 24 Jul 2004 14:23:15 +1000 (EST), Brian Havard wrote:

>On Thu, 22 Jul 2004 11:17:25 -0700, Justin Erenkrantz wrote:
>
>>--On Wednesday, July 21, 2004 9:08 PM +1000 Brian Havard 
>><br...@kheldar.apana.org.au> wrote:

>>> I found the first was a line end problem (OS/2 uses DOS style CR/LF) as
>>> making changes like the diff below makes the test pass. So which is wrong,
>>> the test or the library?
>>
>>I think it's the test in this particular situation.  I think all of the 
>>'output' in the tests should be terminated with APR_EOL_STR as diff outputs 
>>the line encoding of the host OS not what's in the file, IIRC.
>>
>>Yet, if that's the case, I'm wondering how it passes on Win32 then as it 
>>should have the same problem.  Sander?  -- justin
>
>That's what I suspected but I also wondered how/if it passed on windows.

Actually, it turns out that I'd made a change to the diff code to make it
output the right eol characters. If I remove that change the tests pass but
diff output to the console is screwed up. The OS/2 console responds to a LF
character literally, moving down a line but not resetting the column so
output looks like:

line1
     line2
          line3
etc.

So is there any good reason why libsvn_diff always outputs LF for eol
rather than the APR_EOL_STR?

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Line-endings in libsvn_diff was Re: OS/2 port, working through the tests

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Thu, 22 Jul 2004 11:17:25 -0700, Justin Erenkrantz wrote:

>--On Wednesday, July 21, 2004 9:08 PM +1000 Brian Havard 
><br...@kheldar.apana.org.au> wrote:
>
>> Hi all,
>>   I've got the current 1.1 code to build & run on OS/2 and thought it might
>> be nice if it passed the test suit. I haven't built with BDB so I did a
>> "make fsfscheck" and the first failures I hit were
>
>Cool!  Any patches needed for it to build?

Yeah, I'll be submitting a few patches once I'm happy with it. I've still
got a few issues to resolve with the build system (I currently have to edit
the generated Makefiles to make it work). I've fixed a few things in APR
already.



>> I found the first was a line end problem (OS/2 uses DOS style CR/LF) as
>> making changes like the diff below makes the test pass. So which is wrong,
>> the test or the library?
>
>I think it's the test in this particular situation.  I think all of the 
>'output' in the tests should be terminated with APR_EOL_STR as diff outputs 
>the line encoding of the host OS not what's in the file, IIRC.
>
>Yet, if that's the case, I'm wondering how it passes on Win32 then as it 
>should have the same problem.  Sander?  -- justin

That's what I suspected but I also wondered how/if it passed on windows.

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org