[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bugs #10611] NBSbundle pathForResource, comparison of filename wiht ext
From: |
anonymous |
Subject: |
[bugs #10611] NBSbundle pathForResource, comparison of filename wiht extention whit filename without extension |
Date: |
Fri, 08 Oct 2004 00:41:56 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040615 Firefox/0.9 |
This mail is an automated notification from the bugs tracker
of the project: GNUstep.
/**************************************************************************/
[bugs #10611] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10611>
Project: GNUstep
Submitted by: 0
On: Fri 10/08/2004 at 00:34
Category: Base/Foundation
Severity: 5 - Average
Item Group: Bug
Resolution: None
Privacy: Public
Assigned to: None
Status: Open
Summary: NBSbundle pathForResource, comparison of filename wiht extention whit
filename without extension
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;
}
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10611>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bugs #10611] NBSbundle pathForResource, comparison of filename wiht extention whit filename without extension,
anonymous <=