mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fixes from Jeremy Bettis
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
37df5e2822
commit
b418f0eb9b
5 changed files with 22 additions and 22 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-07-24 Jeremy Bettis
|
||||
|
||||
* Source/NSCalendarDate.m: Fix bug adding interval to date.
|
||||
* Source/NSDebug.m: Implemented _NSNewStringFromCString() for gdb.
|
||||
* Source/GSFormat.m: Fix %S format.
|
||||
* Source/NSObject.m: ([conformsToProtocol:]) return NO if passed nul.
|
||||
|
||||
2005-07-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSPathUtilities.m: Fix to avoid duplicate paths.
|
||||
|
|
|
@ -1787,31 +1787,14 @@ NSDictionary *locale)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* This is complicated. We have to transform the wide
|
||||
string into a unicode string. */
|
||||
/* This is simple. Wide string == unicode string. */
|
||||
int prc;
|
||||
unichar *sp;
|
||||
wchar_t *wsp;
|
||||
unichar *wsp;
|
||||
|
||||
len = 0;
|
||||
prc = prec;
|
||||
wsp = (wchar_t *)string;
|
||||
wsp = (unichar *)string;
|
||||
while (prc-- && *wsp++) len++;
|
||||
|
||||
wsp = (wchar_t *)string;
|
||||
|
||||
/* Allocate dynamically an array which definitely is long
|
||||
enough for the wide character version. */
|
||||
if (len < 8192
|
||||
|| ((string = (unichar *) NSZoneMalloc(s->_zone, len * sizeof (unichar)))
|
||||
== NULL))
|
||||
string = (unichar *) alloca (len * sizeof (unichar));
|
||||
else
|
||||
string_malloced = 1;
|
||||
|
||||
prc = len;
|
||||
sp = string;
|
||||
while (prc--) *sp = *wsp;
|
||||
}
|
||||
|
||||
if ((width -= len) <= 0)
|
||||
|
|
|
@ -2558,7 +2558,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
eday += 31;
|
||||
}
|
||||
}
|
||||
if (emonth < smonth)
|
||||
if (emonth < smonth || (emonth == smonth && eday < sday))
|
||||
{
|
||||
eyear -= 1;
|
||||
emonth += 12;
|
||||
|
@ -2585,7 +2585,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
}
|
||||
else
|
||||
{
|
||||
while (diff--)
|
||||
while (diff-- > 0)
|
||||
{
|
||||
int tmpmonth = emonth - diff - 1;
|
||||
int tmpyear = eyear;
|
||||
|
|
|
@ -954,3 +954,9 @@ const char *_NSPrintForDebugger(id object)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NSString *_NSNewStringFromCString(const char *cstring)
|
||||
{
|
||||
return [NSString stringWithCString: cstring];
|
||||
}
|
||||
|
||||
|
|
|
@ -1299,6 +1299,10 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
struct objc_protocol_list* proto_list;
|
||||
|
||||
if (aProtocol == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
for (proto_list = ((struct objc_class*)self)->protocols;
|
||||
proto_list; proto_list = proto_list->next)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue