aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/utils.c b/src/utils.c
index 404484ef4..014136480 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -50,33 +50,30 @@ string_list_free(GList *string_list)
GList *
string_list_find(GList *string_list, gchar *str)
{
- GList *list = g_list_first(string_list);
+ GList *list = g_list_first(string_list);
- while(list)
- {
- if( strcmp(str, (gchar *) list->data) == 0 )
- return list;
- list = list->next;
- }
- return NULL;
+ while(list) {
+ if( strcmp(str, (gchar *) list->data) == 0 )
+ return list;
+ list = list->next;
+ }
+ return NULL;
}
GList *
string_list_remove(GList *string_list, gchar *str)
{
- GList *list = g_list_first(string_list);
+ GList *list = g_list_first(string_list);
- while(list)
- {
- if( strcmp(str, (gchar *) list->data) == 0 )
- {
- g_free(list->data);
- list->data = NULL;
- return g_list_delete_link(string_list, list);
+ while(list) {
+ if( strcmp(str, (gchar *) list->data) == 0 ) {
+ g_free(list->data);
+ list->data = NULL;
+ return g_list_delete_link(string_list, list);
+ }
+ list = list->next;
}
- list = list->next;
- }
- return list;
+ return list;
}
/* create a list suiteble for GCompletion from path */