1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Fix for 233866: NPE on Fresh installed Windows/CDT, patch by Enrico Ehrich <public@snipah.com>

This commit is contained in:
Anton Leherbauer 2008-06-10 10:26:55 +00:00
parent ac107ff7ab
commit 95b4e724c8

View file

@ -6,7 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Intel Corporation - Initial API and implementation
* Intel Corporation - Initial API and implementation
* Enrico Ehrich - http://bugs.eclipse.org/233866
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.gnu.cygwin;
@ -134,11 +135,15 @@ public class CygwinPathResolver implements IBuildPathResolver {
String tail = EMPTY;
while (pattern.length() > 0) {
String key = REGISTRY_KEY + pattern;
String s = user ?
WindowsRegistry.getRegistry().getCurrentUserValue(key, PATH_NAME) :
WindowsRegistry.getRegistry().getLocalMachineValue(key, PATH_NAME);
if (s != null)
return (s.concat(tail).replaceAll(BSLASH, SSLASH));
WindowsRegistry registry = WindowsRegistry.getRegistry();
if (null != registry) {
String s = user ?
registry.getCurrentUserValue(key, PATH_NAME) :
registry.getLocalMachineValue(key, PATH_NAME);
if (s != null)
return (s.concat(tail).replaceAll(BSLASH, SSLASH));
}
if (pattern.equals(ROOTPATTERN))
break; // no other paths to search
int pos = pattern.lastIndexOf(SLASH);