diff -ur gnustep-base-1.11.0/Source/NSPathUtilities.m gnustep-base-1.11.0-test4/Source/NSPathUtilities.m --- gnustep-base-1.11.0/Source/NSPathUtilities.m 2005-06-04 03:22:50.000000000 -0400 +++ gnustep-base-1.11.0-test4/Source/NSPathUtilities.m 2005-09-06 15:28:26.000000000 -0400 @@ -765,13 +765,22 @@ { NSString *s = nil; #if !defined(__MINGW__) + char *env_var; struct passwd *pw; [gnustep_global_lock lock]; - pw = getpwnam ([loginName cString]); - if (pw != 0 && pw->pw_dir != NULL) + // ADC - Add respect for "HOME" env var + if (NULL != (env_var = getenv("HOME"))) { - s = [NSString stringWithCString: pw->pw_dir]; + s = [NSString stringWithCString: env_var]; + } + else + { + pw = getpwnam ([loginName cString]); + if (pw != 0 && pw->pw_dir != NULL) + { + s = [NSString stringWithCString: pw->pw_dir]; + } } [gnustep_global_lock unlock]; #else @@ -836,10 +845,18 @@ { userName = NSUserName(); } - if (gnustepSystemRoot == nil) + if (gnustepSystemRoot == nil + || (defaultsPath == nil) + || (userPath == nil) + || (home == nil) + ) { InitialisePathUtilities(); + defaultsPath = gnustepDefaultsPath; + userPath = gnustepUserPath; + } +/* if ([userName isEqual: NSUserName()]) { home = gnustepUserRoot; @@ -847,8 +864,9 @@ } else { +*/ home = setUserGNUstepPath(userName, &defaultsPath, &userPath); - } +// } if ([defaultsPath isAbsolutePath]) { @@ -859,6 +877,7 @@ home = [home stringByAppendingPathComponent: defaultsPath]; } + return internalizePath(home); }