Fix a few windows bugs with unicode strings.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21791 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-10-09 10:41:53 +00:00
parent 8fcfa3b241
commit e57988b685
3 changed files with 32 additions and 2 deletions

View file

@ -5,6 +5,10 @@
be activated by the GSLogSyslog user default (as the windows event
log is roughly analogous to syslog on unix) rather than being done
by default.
* Source/NSTimeZone.m:
* Source/NSPathUtilities.m:
Fix a few cases where 16bit chartacter strings were being used as 8bit
under windows.
2005-10-07 Chris Vetter <cbv@gmx.net>

View file

@ -350,11 +350,19 @@ static NSString *setUserGNUstepPath(NSString *userName,
dict = GSReadStepConfFile(steprcFile);
if (dict != nil)
{
#if defined(__WIN32__)
PrintOnce("Warning: Configuration: The file %S has been "
"deprecated. Please use the configuration file %s to "
"set standard paths.\n",
(const unichar*)[steprcFile fileSystemRepresentation],
stringify(GNUSTEP_CONFIGURATION_FILE));
#else
PrintOnce("Warning: Configuration: The file %s has been "
"deprecated. Please use the configuration file %s to "
"set standard paths.\n",
[steprcFile fileSystemRepresentation],
stringify(GNUSTEP_CONFIGURATION_FILE));
#endif
forceD = [[dict objectForKey: @"FORCE_DEFAULTS_ROOT"] boolValue];
forceU = [[dict objectForKey: @"FORCE_USER_ROOT"] boolValue];
ASSIGN(oldDRoot, [dict objectForKey: @"GNUSTEP_DEFAULTS_ROOT"]);
@ -629,8 +637,14 @@ GSReadStepConfFile(NSString *fileName)
attributes = [MGR() fileAttributesAtPath: fileName traverseLink: YES];
if (([attributes filePosixPermissions] & 022) != 0)
{
#if defined(__WIN32__)
fprintf(stderr, "The file '%S' is writable by someone other than"
" its owner.\nIgnoring it.\n",
(const unichar*)[fileName fileSystemRepresentation]);
#else
fprintf(stderr, "The file '%s' is writable by someone other than"
" its owner.\nIgnoring it.\n", [fileName fileSystemRepresentation]);
#endif
return nil;
}

View file

@ -910,7 +910,13 @@ static NSMapTable *absolutes = 0;
abbreviationMap = [[NSMutableDictionary alloc] init];
path = _time_zone_path (ABBREV_MAP, nil);
#if defined(__WIN32__)
file = fopen([path fileSystemRepresentation], "rb");
{
unichar mode[3];
mode[0] = 'r';
mode[1] = 'b';
mode[2] = '\0';
file = wfopen([path fileSystemRepresentation], mode);
}
#else
file = fopen([path fileSystemRepresentation], "r");
#endif
@ -1330,7 +1336,13 @@ static NSMapTable *absolutes = 0;
fileName = _time_zone_path (REGIONS_FILE, nil);
#if defined(__WIN32__)
file = fopen([fileName fileSystemRepresentation], "rb");
{
unichar mode[3];
mode[0] = 'r';
mode[1] = 'b';
mode[2] = '\0';
file = wfopen([fileName fileSystemRepresentation], mode);
}
#else
file = fopen([fileName fileSystemRepresentation], "r");
#endif