mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Path operation fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8724 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9a7b25d6ed
commit
603e9ad895
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2001-01-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: Fixes for OPENSTEP compatibility in string path
|
||||
operations - patch provided by Pierre-Yves Rivaille, plus another fix
|
||||
by me.
|
||||
|
||||
2001-01-19 Nicola Pero <nicola@brainstorm.co.uk>
|
||||
|
||||
* gnustep-base.spec.in: Updated copyright and attempt at improving
|
||||
|
|
|
@ -2289,7 +2289,7 @@ handle_printf_atsign (FILE *stream,
|
|||
if (length > 0)
|
||||
{
|
||||
aLength = length - 1;
|
||||
while (aLength > 1)
|
||||
while (aLength > 0)
|
||||
{
|
||||
if (pathSepMember(buf[aLength]) == YES)
|
||||
{
|
||||
|
@ -2721,6 +2721,10 @@ handle_printf_atsign (FILE *stream,
|
|||
NSMutableArray *a;
|
||||
NSArray *r;
|
||||
|
||||
if ([self length] == 0)
|
||||
{
|
||||
return [NSArray array];
|
||||
}
|
||||
a = [[self componentsSeparatedByString: pathSepString] mutableCopy];
|
||||
if ([a count] > 0)
|
||||
{
|
||||
|
@ -2734,8 +2738,8 @@ handle_printf_atsign (FILE *stream,
|
|||
{
|
||||
[a replaceObjectAtIndex: 0 withObject: pathSepString];
|
||||
}
|
||||
/* Any empty path components (except a trailing one) must be removed. */
|
||||
for (i = [a count] - 2; i > 0; i--)
|
||||
/* Any empty path components must be removed. */
|
||||
for (i = [a count] - 1; i > 0; i--)
|
||||
{
|
||||
if ([[a objectAtIndex: i] length] == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue