mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
NSUserDefaults fix for read-only filesystem. Comment type fixes in GSXML.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19034 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8c26943b86
commit
b005bcf6ba
3 changed files with 36 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-04-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSUserDefaults.m: Modified to operate on a read-only
|
||||
filesystem where the defaults database is missing. Application
|
||||
defaults and command line settings should still work.
|
||||
|
||||
2004-04-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSParser.m: Fix error parsing sequence of protocol names
|
||||
|
|
|
@ -3829,7 +3829,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
#ifdef HAVE_LIBXSLT
|
||||
/**
|
||||
* Performs an XSLT transformation on the specified file using the
|
||||
* sytelsheet provided.<br />
|
||||
* stylesheet provided.<br />
|
||||
*
|
||||
* Returns an autoreleased GSXMLDocument containing the transformed
|
||||
* XML, or nil on failure.
|
||||
|
@ -3844,7 +3844,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
|
||||
/**
|
||||
* Performs an XSLT transformation on the specified file using the
|
||||
* sytelsheet and parameters provided. See the libxslt documentation
|
||||
* stylesheet and parameters provided. See the libxslt documentation
|
||||
* for details of the supported parameters.<br />
|
||||
*
|
||||
* Returns an autoreleased GSXMLDocument containing the transformed
|
||||
|
@ -3884,7 +3884,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
}
|
||||
/**
|
||||
* Performs an XSLT transformation on the specified file using the
|
||||
* sytelsheet provided.<br />
|
||||
* stylesheet provided.<br />
|
||||
*
|
||||
* Returns an autoreleased GSXMLDocument containing the transformed
|
||||
* XML, or nil on failure.
|
||||
|
@ -3899,7 +3899,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
|
||||
/**
|
||||
* Performs an XSLT transformation on the specified file using the
|
||||
* sytelsheet and parameters provided.See the libxslt documentation
|
||||
* stylesheet and parameters provided.See the libxslt documentation
|
||||
* for details of the supported parameters.<br />
|
||||
*
|
||||
* Returns an autoreleased GSXMLDocument containing the transformed
|
||||
|
|
|
@ -737,6 +737,8 @@ static NSString *pathForUser(NSString *user)
|
|||
return [self initWithContentsOfFile: path];
|
||||
}
|
||||
|
||||
BOOL read_only = NO;
|
||||
|
||||
/**
|
||||
* <init />
|
||||
* Initializes defaults for the specified path. Returns an object with
|
||||
|
@ -768,6 +770,7 @@ static NSString *pathForUser(NSString *user)
|
|||
{
|
||||
NSWarnMLog(@"Path '%@' is not writable - making user defaults for '%@' "
|
||||
@" read-only\n", path, _defaultsDatabase);
|
||||
|
||||
}
|
||||
else if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO && flag == NO)
|
||||
{
|
||||
|
@ -1441,6 +1444,22 @@ static BOOL isPlistObject(id o)
|
|||
initWithContentsOfFile: _defaultsDatabase];
|
||||
if (newDict == nil)
|
||||
{
|
||||
if (_fileLock == nil)
|
||||
{
|
||||
/*
|
||||
* Running with no readable user defaults ... but we were
|
||||
* initialised that way (possibly on a read-only filesystem)
|
||||
* so we just continue as best we can.
|
||||
*/
|
||||
newDict = [[NSMutableDictionaryClass allocWithZone: [self zone]]
|
||||
initWithCapacity: 4];
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The defaults system has become unreadable singe we started...
|
||||
* probably a severe error of some sort
|
||||
*/
|
||||
NSLog(@"Unable to load defaults from '%@'", _defaultsDatabase);
|
||||
if (wasLocked == NO)
|
||||
{
|
||||
|
@ -1451,6 +1470,7 @@ static BOOL isPlistObject(id o)
|
|||
return NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We enforce the permission mode 0600 on the defaults database
|
||||
|
|
Loading…
Reference in a new issue