Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -532,16 +532,16 @@ [self completeInitialization]; return [super stringByDeletingTrailingWhitespaces]; } -- (OFString*)stringByDeletingLeadingAndTrailingWhitespaces +- (OFString*)stringByDeletingEnclosingWhitespaces { if (initialized != SIZE_MAX) [self completeInitialization]; - return [super stringByDeletingLeadingAndTrailingWhitespaces]; + return [super stringByDeletingEnclosingWhitespaces]; } - (BOOL)hasPrefix: (OFString*)prefix { if (initialized != SIZE_MAX) Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -201,7 +201,7 @@ - (void)deleteTrailingWhitespaces; /** * \brief Deletes all whitespaces at the beginning and the end of the string. */ -- (void)deleteLeadingAndTrailingWhitespaces; +- (void)deleteEnclosingWhitespaces; @end Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -600,11 +600,11 @@ /* We don't really care, as we only made it smaller */ [e release]; } } -- (void)deleteLeadingAndTrailingWhitespaces +- (void)deleteEnclosingWhitespaces { size_t d, i; char *p; d = 0; Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -624,11 +624,11 @@ * Creates a new string by deleting leading and trailing whitespaces. * * \return A new autoreleased OFString with leading and trailing whitespaces * deleted */ -- (OFString*)stringByDeletingLeadingAndTrailingWhitespaces; +- (OFString*)stringByDeletingEnclosingWhitespaces; /** * Checks whether the string has the specified prefix. * * \param prefix The prefix to check for Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -1515,15 +1515,15 @@ */ new->isa = [OFString class]; return new; } -- (OFString*)stringByDeletingLeadingAndTrailingWhitespaces +- (OFString*)stringByDeletingEnclosingWhitespaces { OFMutableString *new = [[self mutableCopy] autorelease]; - [new deleteLeadingAndTrailingWhitespaces]; + [new deleteEnclosingWhitespaces]; /* * Class swizzle the string to be immutable. We declared the return type * to be OFString*, so it can't be modified anyway. But not swizzling it * would create a real copy each time -[copy] is called. Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -390,11 +390,11 @@ acceptProlog = NO; pi = [pi substringFromIndex: 3 toIndex: [pi length]]; - pi = [pi stringByDeletingLeadingAndTrailingWhitespaces]; + pi = [pi stringByDeletingEnclosingWhitespaces]; cString = [pi cString]; length = [pi cStringLength]; for (i = last = 0; i < length; i++) { @@ -768,11 +768,11 @@ return; if ((length = *i - *last) > 0) cache_append(cache, buffer + *last, encoding, length); - [cache deleteLeadingAndTrailingWhitespaces]; + [cache deleteEnclosingWhitespaces]; cacheCString = [cache cString]; cacheLength = [cache cStringLength]; if ((tmp = memchr(cacheCString, ':', cacheLength)) != NULL) { Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -476,17 +476,15 @@ R([s[0] deleteTrailingWhitespaces]) && [s[0] isEqual: @" \r \t\n\t \tasd"] && (s[0] = [OFMutableString stringWithString: whitespace[1]]) && R([s[0] deleteTrailingWhitespaces]) && [s[0] isEqual: @""]) - TEST(@"-[deleteLeadingAndTrailingWhitespaces]", + TEST(@"-[deleteEnclosingWhitespaces]", (s[0] = [OFMutableString stringWithString: whitespace[0]]) && - R([s[0] deleteLeadingAndTrailingWhitespaces]) && - [s[0] isEqual: @"asd"] && + R([s[0] deleteEnclosingWhitespaces]) && [s[0] isEqual: @"asd"] && (s[0] = [OFMutableString stringWithString: whitespace[1]]) && - R([s[0] deleteLeadingAndTrailingWhitespaces]) && - [s[0] isEqual: @""]) + R([s[0] deleteEnclosingWhitespaces]) && [s[0] isEqual: @""]) TEST(@"-[stringByXMLEscaping]", (s[0] = (id)[@" &world'\"!&" stringByXMLEscaping]) && [s[0] isEqual: @"<hello> &world'"!&"])