]> git.saurik.com Git - apple/cf.git/commitdiff
CF-368.25.tar.gz mac-os-x-1044ppc mac-os-x-1045ppc mac-os-x-1046ppc v368.25
authorApple <opensource@apple.com>
Tue, 10 Jan 2006 21:34:14 +0000 (21:34 +0000)
committerApple <opensource@apple.com>
Tue, 10 Jan 2006 21:34:14 +0000 (21:34 +0000)
URL.subproj/CFURL.c

index c178d8941d1640fdf4c9de36d1d9335c699e6479..b4461198236e79f8785dc59172c3891830c4fd1b 100644 (file)
@@ -1405,24 +1405,24 @@ static void computeSanitizedString(CFURLRef url) {
         if (!scanCharacters(alloc, & sanitizedString, &(((struct __CFURL *)url)->_flags), cstring, ustring, useCString, base, string_length, &mark, 0, url->_encoding)) {
             ((struct __CFURL *)url)->_flags |= ORIGINAL_AND_URL_STRINGS_MATCH;
         }
-               if ( sanitizedString )
-                       _setSanitizedString( (struct __CFURL*) url, sanitizedString );
+        if ( sanitizedString ) {
+            _setSanitizedString( (struct __CFURL*) url, sanitizedString );
+        }
     } else {
         // Go component by component
         CFIndex currentComponent = HAS_USER;
         mark = 0;
+        CFMutableStringRef sanitizedString = NULL;
         while (currentComponent < (HAS_FRAGMENT << 1)) {
             CFRange componentRange = _rangeForComponent(url->_flags, url->ranges, currentComponent);
             if (componentRange.location != kCFNotFound) {
-                               CFMutableStringRef      sanitizedString = NULL;
                 scanCharacters(alloc, & sanitizedString, &(((struct __CFURL *)url)->_flags), cstring, ustring, useCString, componentRange.location, componentRange.location + componentRange.length, &mark, currentComponent, url->_encoding);
-                               
-                               if ( sanitizedString )
-                                       _setSanitizedString( (struct __CFURL*) url, sanitizedString );
             }
             currentComponent = currentComponent << 1;
         }
-        if (!_getSanitizedString(url)) {
+        if (sanitizedString) {
+            _setSanitizedString((struct __CFURL *)url, sanitizedString);
+        } else {
             ((struct __CFURL *)url)->_flags |= ORIGINAL_AND_URL_STRINGS_MATCH;
         }
     }