URL: <http://savannah.gnu.org/bugs/?18431>
Summary: +[NSURL URLWithString:relativeToURL:] creates a URL with invalid input Project: GNUstep Submitted by: iamleeg Submitted on: Friday 12/01/2006 at 12:06 Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: According to the GNUstep documentation: If the string cannot be parsed the method returns nil. According to the Cocoa documentation: The NSURL class will fail to create a new NSURL object if the path being passed is not well-formed—the path must comply with RFC 2396. Examples of cases that will not succeed are strings containing space characters and high-bit characters. Should creating an NSURL object fail, the creation methods will return nil, which you must be prepared to handle. However, the test: NSURL *url = [NSURL URLWithString:@"this isn't a URL"]; NSLog (@"Got URL: %@", url); 2006-12-01 12:02:26.066 basic[6402] URL: this isn't a URL shows that non-conforming URLs don't cause a nil return. I've codified this as a test on NSURL, with the patch to the testsuite attached. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Friday 12/01/2006 at 12:06 Name: nsurl-nilreturntest-patch Size: 544B By: iamleeg Testsuite patch to verify (partial) fix of this bug <http://savannah.gnu.org/bugs/download.php?file_id=11419> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?18431> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-gnustep mailing list Bug-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnustep