bugGNUstep - Bugs: bug #10611, NBSbundle pathForResource,...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #10611: NBSbundle pathForResource, comparison of filename wiht extention whit filename without extension

Submitted by:  None
Submitted on:  Fri 08 Oct 2004 04:34:44 AM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Adam Fedor <fedor>
Open/Closed: Closed

Fri 30 Jan 2009 07:22:25 PM UTC, comment #2:

closing as fixed

Richard Frith-Macdonald <CaS>
Project Member
Thu 14 Oct 2004 04:09:17 AM UTC, comment #1:

It appears from the documentation that this is correct. I've fixed this, Thanks.

Adam Fedor <fedor>
Project AdministratorIn charge of this item.
Fri 08 Oct 2004 04:34:44 AM UTC, original submission:

GXSMLParser with dtd loading :

<!DOCTYPE scene PUBLIC "-//AAV//DTD scene//FR" "scene.dtd">

It doesn't wotk. If I replace "scene.dtd" by "scene" and rename this file in the Resources/DTDs directory it works.

I think that the problem is in NSBundle _bundle_name_first_match method.
It compares a file name with or without an extension with a file without extension. I think thart we have first to remove the extension of the 'cleanname' ?

Thanks
Francis.

NSBundle.m

/* Find the first directory entry with a given name (with any extension)
*/
static NSString *
_bundle_name_first_match(NSString* directory, NSString* name)
{
NSFileManager *mgr = [NSFileManager defaultManager];
NSEnumerator *filelist;
NSString *path;
NSString *match;
NSString *cleanname;

/* name might have a directory in it also, so account for this */
path = [[directory stringByAppendingPathComponent: name]
stringByDeletingLastPathComponent];

##################### my modification HERE
cleanname = [[name lastPathComponent]stringByDeletingPathExtension];
#####################

filelist = [[mgr directoryContentsAtPath: path] objectEnumerator];
while ((match = [filelist nextObject]))
{
if ([cleanname isEqual: [match stringByDeletingPathExtension]])
return [path stringByAppendingPathComponent: match];
}

return nil;
}

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Jan 2009 07:22:25 PM UTCCaSOpen/ClosedIn Test=>Closed
    Thu 14 Oct 2004 04:09:17 AM UTCfedorStatusNone=>Fixed
      Assigned toNone=>fedor
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1