#!/usr/bin/perl
while (<>) {
    s!\b([a-z]):((?:[/\\][^/\\\s]+)+)!"/cygdrive/$1" . &fixslash($2)!eg;
    s!(.)\\(.)!"$1" . "\/" . "$2"!eg;
    print;
}

sub fixslash {
    my $x = shift;
    $x =~ s%\\%/%g;
    return $x;
}

#!/usr/bin/perl
while (<>) {
    s!\b([a-z]:(?:[/\\][^/\\\s]+)+)!&fix($1)!eg;
    print;
}

sub fix {
    my $x = `cygpath -u '$_[0]'`;
    chomp $x;
    return $x;
}
