String>>withNormalizedLineDelimiters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

String>>withNormalizedLineDelimiters

Chris Uppal-3
Seems to be buggy.  If I'm understanding what its trying to do, then I think
the main loop should read:

 stm do: [:c |
  c == lf
   ifTrue: [target nextPut: cr; nextPutAll: eol]
   ifFalse: [
    c == cr
     ifTrue: [
      stm peekFor: lf.
      target nextPutAll: eol]
     ifFalse: [target nextPut: c]]].

The two occurences of nextPutAll: eol are the changes.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: String>>withNormalizedLineDelimiters

Chris Uppal-3
I wrote:
>
>  stm do: [:c |
>   c == lf
>    ifTrue: [target nextPut: cr; nextPutAll: eol]
>    ifFalse: ...

Sorry, that should have read:

 stm do: [:c |
  c == lf
   ifTrue: [target nextPutAll: eol]
   ifFalse: ...

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: String>>withNormalizedLineDelimiters

Blair McGlashan
"Chris Uppal" <[hidden email]> wrote in message
news:[hidden email]...

> I wrote:
> >
> >  stm do: [:c |
> >   c == lf
> >    ifTrue: [target nextPut: cr; nextPutAll: eol]
> >    ifFalse: ...
>
> Sorry, that should have read:
>
>  stm do: [:c |
>   c == lf
>    ifTrue: [target nextPutAll: eol]
>    ifFalse: ...
>
>     -- chris


Thanks Chris, defect 249.

Regards

Blair