[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bugs #10611] NBSbundle pathForResource, comparison of filename wiht ext
From: |
Adam Fedor |
Subject: |
[bugs #10611] NBSbundle pathForResource, comparison of filename wiht extention whit filename without extension |
Date: |
Thu, 14 Oct 2004 00:32:18 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5 (KHTML, like Gecko) Safari/125.9 |
This mail is an automated notification from the bugs tracker
of the project: GNUstep.
/**************************************************************************/
[bugs #10611] Latest Modifications:
Changes by:
Adam Fedor <fedor@gnu.org>
'Date:
Thu 10/14/2004 at 04:09 (US/Mountain)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Fixed
Assigned to | None | fedor
Status | Open | In Test
------------------ Additional Follow-up Comments ----------------------------
It appears from the documentation that this is correct. I've fixed this, Thanks.
/**************************************************************************/
[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 04:34
Category: Base/Foundation
Severity: 5 - Average
Item Group: Bug
Resolution: Fixed
Privacy: Public
Assigned to: fedor
Status: In Test
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;
}
Follow-up Comments
------------------
-------------------------------------------------------
Date: Thu 10/14/2004 at 04:09 By: Adam Fedor <fedor>
It appears from the documentation that this is correct. I've fixed this, Thanks.
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/