Why are Windows paths broken in make 3.81?

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Wed Jul 26 18:25:00 GMT 2006


On Wed, Jul 26, 2006 at 12:26:09PM -0400, Christopher Faylor wrote:
>Maybe someone here would be willing to post a sed transformation which
>would change c:\some\dos\path to /cygdrive/c/some/dos/path.

Here are two simple, imperfect proof-of-concept perl scripts.
The first one just translates everything to /cygdrive/X/foo. The second
one uses cygpath to get mount-table-aware paths.
And, to reiterate: I know that these aren't perfect and miss some cases
(like when part of a filename is located in a variable). I merely offer
them as is as an example of what could be done.
cgf
#!/usr/bin/perl
while (<>) {
 s!\b([a-z]):((?:[/\\][^/\\\s]+)+)!"/cygdrive/1ドル" . &fixslash(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;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /