Fix for user name on Windows.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2014-03-28 00:59:13 +00:00
parent 9d220fdfad
commit 93438554c3
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2014-03-27 German Arias <germanandre@gmx.es>
* Framework/PCFileCreator.m: Be sure to use an UTF8 string for the user
name on Windows.
2014-03-08 German Arias <germanandre@gmx.es>
* Framework/PCFileManager.m (-isTextFile:): Rewrite this method to work

View file

@ -297,12 +297,26 @@ static NSDictionary *dict = nil;
while ((subRange = [file rangeOfString:@"$USERNAME$"]).length)
{
#ifdef WIN32
// Be sure to use an UTF8 string.
[file replaceCharactersInRange: subRange
withString: [NSString stringWithCString:
[NSUserName() UTF8String]]];
#else
[file replaceCharactersInRange:subRange withString:NSUserName()];
#endif
}
while ((subRange = [file rangeOfString:@"$FULLUSERNAME$"]).length)
{
#ifdef WIN32
// Be sure to use an UTF8 string.
[file replaceCharactersInRange: subRange
withString: [NSString stringWithCString:
[NSFullUserName() UTF8String]]];
#else
[file replaceCharactersInRange:subRange withString:NSFullUserName()];
#endif
}
while ((subRange = [file rangeOfString:@"$PROJECTNAME$"]).length)