]> wimlib.net Git - wimlib/commitdiff
inode_get_ads_entry(): de-indent
authorEric Biggers <ebiggers3@gmail.com>
Tue, 13 May 2014 01:31:46 +0000 (20:31 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 13 May 2014 01:31:46 +0000 (20:31 -0500)
src/inode.c

index e2f291631a043048273daf47fd1a958dc4209a2e..f6e14e97d6a9c0f0e0fae63c2753eecdd8a75cd6 100644 (file)
@@ -141,53 +141,52 @@ struct wim_ads_entry *
 inode_get_ads_entry(struct wim_inode *inode, const tchar *stream_name,
                    u16 *idx_ret)
 {
-       if (inode->i_num_ads == 0) {
+       size_t stream_name_utf16le_nbytes;
+       u16 i;
+       struct wim_ads_entry *result;
+
+       if (inode->i_num_ads == 0)
                return NULL;
-       } else {
-               size_t stream_name_utf16le_nbytes;
-               u16 i;
-               struct wim_ads_entry *result;
 
-               if (stream_name[0] == T('\0'))
-                       return NULL;
+       if (stream_name[0] == T('\0'))
+               return NULL;
 
-       #if TCHAR_IS_UTF16LE
-               const utf16lechar *stream_name_utf16le;
+#if TCHAR_IS_UTF16LE
+       const utf16lechar *stream_name_utf16le;
 
-               stream_name_utf16le = stream_name;
-               stream_name_utf16le_nbytes = tstrlen(stream_name) * sizeof(tchar);
-       #else
-               utf16lechar *stream_name_utf16le;
+       stream_name_utf16le = stream_name;
+       stream_name_utf16le_nbytes = tstrlen(stream_name) * sizeof(tchar);
+#else
+       utf16lechar *stream_name_utf16le;
 
+       {
+               int ret = tstr_to_utf16le(stream_name,
+                                         tstrlen(stream_name) *
+                                             sizeof(tchar),
+                                         &stream_name_utf16le,
+                                         &stream_name_utf16le_nbytes);
+               if (ret)
+                       return NULL;
+       }
+#endif
+       i = 0;
+       result = NULL;
+       do {
+               if (ads_entry_has_name(&inode->i_ads_entries[i],
+                                      stream_name_utf16le,
+                                      stream_name_utf16le_nbytes,
+                                      default_ignore_case))
                {
-                       int ret = tstr_to_utf16le(stream_name,
-                                                 tstrlen(stream_name) *
-                                                     sizeof(tchar),
-                                                 &stream_name_utf16le,
-                                                 &stream_name_utf16le_nbytes);
-                       if (ret)
-                               return NULL;
+                       if (idx_ret)
+                               *idx_ret = i;
+                       result = &inode->i_ads_entries[i];
+                       break;
                }
-       #endif
-               i = 0;
-               result = NULL;
-               do {
-                       if (ads_entry_has_name(&inode->i_ads_entries[i],
-                                              stream_name_utf16le,
-                                              stream_name_utf16le_nbytes,
-                                              default_ignore_case))
-                       {
-                               if (idx_ret)
-                                       *idx_ret = i;
-                               result = &inode->i_ads_entries[i];
-                               break;
-                       }
-               } while (++i != inode->i_num_ads);
-       #if !TCHAR_IS_UTF16LE
-               FREE(stream_name_utf16le);
-       #endif
-               return result;
-       }
+       } while (++i != inode->i_num_ads);
+#if !TCHAR_IS_UTF16LE
+       FREE(stream_name_utf16le);
+#endif
+       return result;
 }
 
 static int