View | Details | Raw Unified | Return to issue 18132
Collapse All | Expand All

(-)set_soenv.in (-17 / +27 lines)
Lines 1034-1040 if (($platform eq "$Linux") || ($platfo Link Here
1034
   } else {
1034
   } else {
1035
      @javaBits = (); 
1035
      @javaBits = (); 
1036
   }
1036
   }
1037
   $PATH             .= GetCorrectPath ($PATH, $COMPATH, $CC,
1037
   $PATH              = GetCorrectPath ($PATH, $COMPATH, $CC,
1038
                                        $PERL_PATH, 'perl',
1038
                                        $PERL_PATH, 'perl',
1039
					$TCSH_PATH, 'tcsh',
1039
					$TCSH_PATH, 'tcsh',
1040
                                        @javaBits);
1040
                                        @javaBits);
Lines 2324-2353 sub GetCorrectPath Link Here
2324
	    return '';
2324
	    return '';
2325
	}
2325
	}
2326
2326
2327
	sub SaneGrep
2328
	{
2329
	    # Perl grep is unbelievably strange.
2330
	    my $needle = shift;
2331
	    my $haystack;
2332
	    while ($haystack = shift) {
2333
		if ($needle eq $haystack) {
2334
		    return 1;
2335
		} 
2336
	    }
2337
	    return 0;
2338
	}	
2339
2327
	sub CleanupPath
2340
	sub CleanupPath
2328
	{
2341
	{
2329
	    my $elem = shift;
2342
	    my @elements = @_;
2330
	    my @rest = @_;
2343
	    my @cleanName = ();
2331
	    my @result = ($elem);
2344
	    my $elem;
2332
	    
2345
2333
	    if (@rest) {
2346
	    while ($elem = shift @elements) {
2334
		my @chew = CleanupPath(@rest);
2347
		if (!SaneGrep ($elem, @cleanName)) {
2335
		
2348
			push @cleanName, $elem;
2336
		for $a (@chew) {
2337
		    if (!($a eq $elem)) {
2338
			push @result, $a;
2339
		    }
2340
		}
2349
		}
2341
		return @result;
2342
	    } else {
2343
		return $elem;
2344
	    }
2350
	    }
2351
2352
	    return @cleanName;
2345
	}
2353
	}
2346
2354
2347
	my $oldPath = shift;
2355
	my $oldPath = shift;
2348
	my @originalPairs = @_;
2356
	my @originalPairs = @_;
2349
	my @pairs = @originalPairs;
2357
	my @pairs = @originalPairs;
2350
	my @Path = split /$ds/, $oldPath;
2358
	my @Path = split /$ps/, $oldPath;
2359
2360
	print "Old path: $oldPath\n";
2351
2361
2352
	while (@pairs) {
2362
	while (@pairs) {
2353
	    my $path = shift @pairs;
2363
	    my $path = shift @pairs;
Lines 2393-2399 sub GetCorrectPath Link Here
2393
	    }
2403
	    }
2394
	}
2404
	}
2395
2405
2396
	return join $ds, CleanupPath (@Path);
2406
	return join $ps, CleanupPath (@Path);
2397
}
2407
}
2398
2408
2399
#------------------------------------------------------------
2409
#------------------------------------------------------------

Return to issue 18132