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

Group
 
 

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

Submitter:  None
Submitted:  Fri 08 Oct 2004 04:34:44 AM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  fedor
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

closing as fixed

Richard Frith-Macdonald <CaS>
Group 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>
Group administrator
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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-01-30 CaS Open/ClosedIn Test Closed
    2004-10-14 fedor StatusNone Fixed
        Assigned toNone fedor
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code