Lines Matching refs:path
195 my ($path) = @_;
198 return $path if (!os_is_win());
201 return $path if ($path eq '');
203 if($path =~ s{^([a-zA-Z]):$}{\u$1:}) {
210 return $path;
212 elsif($path =~ m{^\\} || $path =~ m{^[a-zA-Z]:[^/\\]}) {
221 my $first_char = ucfirst(substr($path, 0, 1));
224 $path =~ s{[\\/]+}{/}g;
228 substr($path, 0, 1, $first_char);
229 return $path;
236 $path =~ s{^([\\/])[\\/]+}{$1}g;
238 my $has_final_slash = ($path =~ m{[/\\]$});
241 chomp($path = `cygpath -m '$path'`);
248 $path .= '/' if($has_final_slash);
252 $path =~ s{//+}{/}g;
254 return $path;
260 $path = do_msys_transform($path);
261 return undef if !defined $path;
264 $path =~ s{^([a-z]:)}{\u$1};
267 $path =~ s{[\\/]+}{/}g;
268 return $path;
270 elsif($path =~ s{^([a-zA-Z]):[/\\]}{\u$1:/}) {
274 $path =~ s{[\\/]+}{/}g;
275 return $path;
277 elsif($path !~ m{^/}) {
281 $path =~ s{[\\/]+}{/}g;
282 return $path;
287 return do_dumb_guessed_transform($path);
296 my ($path) = @_;
300 $path = Cwd::abs_path($path);
303 return $path;
306 if($path =~ m{^([a-zA-Z]):($|[^/\\].*$)}) {
313 elsif($path eq '') {
322 my $has_final_slash = ($path =~ m{[\\/]$});
326 $path =~ s{^([\\/])[\\/]+}{$1}g;
328 print "Inter result: \"$path\"\n";
331 chomp($path = `cygpath -m -a '$path'`);
338 $path .= '/' if($has_final_slash);
342 $path =~ s{//+}{/}g;
344 return $path
346 elsif($path =~ s{^([a-zA-Z]):[/\\]}{\u$1:/}) {
351 return normalize_path($path);
353 elsif(substr($path, 0, 1) eq '\\' ) {
362 return normalize_path($w32drive . $path);
365 if(substr($path, 0, 1) ne '/') {
384 $path = $cur_dir . '/' . $path;
388 $path = normalize_path($path);
389 return undef unless defined $path;
394 $path = do_msys_transform($path);
395 return undef if !defined $path;
398 $path =~ s{[\\/]+}{/}g;
399 return $path;
404 return do_dumb_guessed_transform($path);
416 my ($path) = @_;
420 $path = Cwd::abs_path($path);
423 return $path;
426 if($path =~ m{^([a-zA-Z]):($|[^/\\].*$)}) {
436 $path = get_abs_path_on_win32_drive($1, $2);
437 return undef if !defined $path;
439 return simple_transform_win32_to_unix($path);
441 elsif($path eq '') {
447 chomp($path = `bash -c 'pwd -L'`);
450 chomp($path = `pwd -L`);
458 $path .= '/' if length($path) > 2;
459 return $path;
464 my $has_final_slash = ($path =~ m{[\\/]$});
469 $path = normalize_path($path);
470 return undef if !defined $path;
474 chomp($path = `cygpath -u -a '$path'`);
482 $path .= '/' if($has_final_slash &&
483 substr($path, length($path) - 1, 1) ne '/');
485 return $path
487 elsif($path =~ m{^[a-zA-Z]:[/\\]}) {
494 $path = normalize_path($path);
495 return undef if !defined $path;
497 return simple_transform_win32_to_unix($path);
499 elsif(substr($path, 0, 1) eq '\\') {
510 $path = normalize_path($w32drive . $path);
511 return undef if !defined $path;
513 return simple_transform_win32_to_unix($path);
517 if(substr($path, 0, 1) ne '/') {
536 $path = $cur_dir . '/' . $path;
539 return normalize_path($path);
551 my ($path) = @_;
554 return $path if $path eq '';
556 if($path !~ m{(?:^|\\|/)\.{1,2}(?:\\|/|$)}) {
558 my $first_char = substr($path, 0, 1);
559 $path =~ s{[\\/]+}{/}g;
561 substr($path, 0, 1, $first_char);
562 return $path;
570 if($path =~ m{^([a-zA-Z]:(/|\\)?)(.*$)}) {
579 if($path =~ m{^(\/|\\)}) {
586 @arr = split(m{\/|\\}, $path);
603 warn "Error processing path \"$path\": " .
609 $ret .= '/' if($path =~ m{\\$|/$} && scalar @res > 0);
617 my ($path) = @_;
619 return $path if $path eq '';
623 $path =~ s{^/[/\\]+}{/};
628 $path = `cmd //c echo '$path'`;
637 $path =~ s{^\"|\"$|\"\r|\n|\r}{}g;
639 return $path;
684 my ($path) = @_;
688 $path =~ s{[/\\]+}{/}g;
691 return undef if (length($path) == 0);
700 if($path =~ m{$drv_ltr_re}) {
710 my $check_path = $path;
716 if($? == 0 && substr($path, 0, 1) ne '%') {
739 warn "Can't determine Win32 directory for path \"$path\".\n";
748 my ($path) = @_;
753 chomp($res = `cygpath -a -u '$path'`);
756 "directory \"$path\".\n";
762 $path =~ m{[/\\]$});
767 if($path !~ s{^([a-zA-Z]):(?:/|\\)}{/\l$1/}) {
769 "directory \"$path\".\n";
773 $path = '/cygdrive' . $path if(drives_mounted_on_cygdrive());
774 return $path;