- /* Only perform the next set of operations if the preset name
- contains a valid extension */
- if (is_valid_extension(name_list[i]->d_name)) {
-
- /* Handle the out of memory case. My guess is xmms would
- crash before this program would, but whatever...*/
- if ((preset_name = (char*)malloc(MAX_PATH_SIZE)) == NULL) {
- if (PRESET_DEBUG) printf("loadPresetDir: out of memory! \n");
-
- /* Free the rest of the dirent name list */
- for (j = i; j < dir_size; j++)
- free(name_list[j]);
- destroy_splaytree(chrono_order_preset_name_tree);
- return OUTOFMEM_ERROR;
- }
-
- /* Now create the full path */
- if (get_preset_path(&preset_name, dir, name_list[i]->d_name) < 0) {
- if (PRESET_DEBUG) printf("loadPresetDir: failed to generate full preset path name!\n");
-
- /* Free the rest of the dirent name list */
- for (j = i; j < dir_size; j++)
- free(name_list[j]);
- destroy_splaytree(chrono_order_preset_name_tree);
- return OUTOFMEM_ERROR;
-
- }
-
- /* Insert the character string into the splay tree, with the key being its sequence number */
- splay_insert(preset_name, &preset_name_buffer_size, chrono_order_preset_name_tree);
- preset_name_buffer_size++;
- }
-
- /* Free the dirent struct */
- free(name_list[i]);
-
- }
-
+ /* Only perform the next set of operations if the preset name
+ contains a valid extension */
+ if (is_valid_extension(name_list[i]->d_name)) {
+
+ /* Handle the out of memory case. My guess is xmms would
+ crash before this program would, but whatever...*/
+ if ((preset_name = (char*)malloc(MAX_PATH_SIZE)) == NULL) {
+ if (PRESET_DEBUG) printf("loadPresetDir: out of memory! \n");
+
+ /* Free the rest of the dirent name list */
+ for (j = i; j < dir_size; j++)
+ free(name_list[j]);
+ destroy_splaytree(chrono_order_preset_name_tree);
+ return OUTOFMEM_ERROR;
+ }
+
+ /* Now create the full path */
+ if (get_preset_path(&preset_name, dir, name_list[i]->d_name) < 0) {
+ if (PRESET_DEBUG) printf("loadPresetDir: failed to generate full preset path name!\n");
+
+ /* Free the rest of the dirent name list */
+ for (j = i; j < dir_size; j++)
+ free(name_list[j]);
+ destroy_splaytree(chrono_order_preset_name_tree);
+ return OUTOFMEM_ERROR;
+
+ }
+
+ /* Insert the character string into the splay tree, with the key being its sequence number */
+ splay_insert(preset_name, &preset_name_buffer_size, chrono_order_preset_name_tree);
+ preset_name_buffer_size++;
+ }
+
+ /* Free the dirent struct */
+ free(name_list[i]);
+
+ }
+