You are here: Foswiki>Tasks Web>Item12707 (31 May 2014, GeorgeClark)Edit Attach

Item12707: RcsLite does not cope with DOS format running under linux

pencil
Priority: Low
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: RcsLite
Branches:
Reported By: JulianLevens
Waiting For:
Last Change By: GeorgeClark
In testing in a linux VM with data stored in a shared Windows directory, I discovered that revisions were all returned as current with RcsLite (RcsWrap was OK).

I was immediately suspicious of line ending.

My patch came down to:
my %is_space = ( ' ' => 1, "\t" => 1, "\n" => 1, "\r" => 1 );

sub _readTo {
    my ( $file, $term ) = @_;
    my $buf = '';
    my $ch;
    my $space  = 1;   # there's a pseudo-newline before every new token
    my $string = '';
    my $state  = 0;   # 0 = looking for @, 1 = reading string, 2 = seen second @

    while ( read( $file, $ch, 1 ) ) {
    
+       next if $ch eq "\r";

        if ( $ch eq '@' ) {
            if ( $state == 1 ) {    # if $state eq '@'
                $state = 2;         #     $state = 'e'
            }

I doubt that hack is quite right as there is logic handling whitespace using %is_space hash. However, it did mean that revisions now return correctly.

Assuming that there is a real need to handle "\r" before the newline then this fix will need more work.

I note that this is an unusual set-up hence the low priority assigned.

-- JulianLevens - 03 Jan 2014

 

ItemTemplate edit

Summary RcsLite does not cope with DOS format running under linux
ReportedBy JulianLevens
Codebase
SVN Range
AppliesTo Engine
Component RcsLite
Priority Low
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r2 - 31 May 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy