Anonymous avatar Anonymous committed 3a5fa57

INTEGRATION: CWS kendy21 (1.199.6); FILE MERGED
2008/09/01 12:28:10 kendy 1.199.6.1: #i93333#
A PATH in Cygwin can contain something like /bin:"C:\blah\bleh":/ugh, fix its handling.

Comments (0)

Files changed (1)

config_office/set_soenv.in

 #!@PERL@ -w
 #
 # Program:     set_soenv.in
-# Version:     $Revision: 1.200 $
-# Date:        $Date: 2008-08-27 13:56:09 $
+# Version:     $Revision: 1.201 $
+# Date:        $Date: 2008-09-05 14:14:29 $
 # Author:      Willem van Dorp, Ross Nicholson, Oisin Boydell - Sun Microsystems, Ireland.
 #
 #---------------------------------------------------------------------------
    if (($^O eq "cygwin")) { # Not for ActiveState perl
        my $expandedPATH = $PATH;
        $expandedPATH =~ s/(\$\w+)/$1/eeg;
-       foreach my $pathentry (split($ps,$oldPATH)) {
+
+       # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh
+       my $fixedPATH = $oldPATH;
+       if ( $oldPATH =~ /"/ ) {
+	   $fixedPATH = "";
+	   foreach my $pathentry ( split( '"',$oldPATH ) ) {
+	       if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) {
+		   $fixedPATH .= $pathentry;
+	       } else {
+		   chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ;
+		   chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ;
+		   $fixedPATH .= $pathentry;
+	       }
+	   }
+       }
+
+       foreach my $pathentry (split($ps,$fixedPATH)) {
            if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) {
                $PATH .= $ps.$pathentry;
                $expandedPATH .= $ps.$pathentry;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.