backport small fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@33223 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-06-01 15:19:38 +00:00
parent 1cb2b4d31e
commit 096ec28933
3 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2011-06-01 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSString.h: Add explicit warnings about OSX
compatible modifications to values returned by path methods.
* Source/NSTimeZone.m: Don't guess at tzname[0] if the value of
daylight shows it's not valid.
2011-05-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSString.m (-initWithFormat:locale:): Make sure va_end()

View file

@ -550,6 +550,10 @@ typedef NSUInteger NSStringEncodingConversionOptions;
* @"/" with @"/file" produces @"/file"
* @"path with @"C:/file" produces @"path/file"
* </example>
* NB. Do not use this method to modify strings other than filesystem
* paths as the behavior in such cases is undefined ... for instance
* the string may have repeated slashes or slash-dot-slash sequences
* removed.
*/
- (NSString*) stringByAppendingPathComponent: (NSString*)aString;
@ -571,6 +575,10 @@ typedef NSUInteger NSStringEncodingConversionOptions;
* @"/" with @"app" produces @"/" (no file name to append to)
* @"" with @"app" produces @"" (no file name to append to)
* </example>
* NB. Do not use this method to modify strings other than filesystem
* paths as the behavior in such cases is undefined ... for instance
* the string may have repeated slashes or slash-dot-slash sequences
* removed.
*/
- (NSString*) stringByAppendingPathExtension: (NSString*)aString;
@ -593,6 +601,10 @@ typedef NSUInteger NSStringEncodingConversionOptions;
* @"//host/share/" produces @"//host/share/" (a UNC path)
* @"//path/file" produces @"//path" (an absolute Unix path)
* </example>
* NB. Do not use this method to modify strings other than filesystem
* paths as the behavior in such cases is undefined ... for instance
* the string may have repeated slashes or slash-dot-slash sequences
* removed.
*/
- (NSString*) stringByDeletingLastPathComponent;
@ -613,6 +625,10 @@ typedef NSUInteger NSStringEncodingConversionOptions;
* @"/.ext" produces @"/.ext" (there is no file to strip from)
* @".ext" produces @".ext" (there is no file to strip from)
* </example>
* NB. Do not use this method to modify strings other than filesystem
* paths as the behavior in such cases is undefined ... for instance
* the string may have repeated slashes or slash-dot-slash sequences
* removed.
*/
- (NSString*) stringByDeletingPathExtension;

View file

@ -1526,13 +1526,16 @@ static NSMapTable *absolutes = 0;
}
#if HAVE_TZSET
/*
* Try to get timezone from tzset and tzname
* Try to get timezone from tzset and tzname/daylight.
* If daylight is non-zero, then tzname[0] is only the name
* the the zone for part of the year, so we can't use it as
* the definitive zone.
*/
if (localZoneString == nil)
{
localZoneSource = @"function: 'tzset()/tzname'";
tzset();
if (tzname[0] != NULL && *tzname[0] != '\0')
if (NULL != tzname[0] && '\0' != *tzname[0] && 0 == daylight)
localZoneString = [NSString stringWithUTF8String: tzname[0]];
}
#endif