Refactored cmd_join to use parse_options

This commit is contained in:
James Booth
2014-04-14 23:36:00 +01:00
parent 428d9eb936
commit 3e69d6b71e
2 changed files with 17 additions and 35 deletions

View File

@@ -390,13 +390,13 @@ parse_options(gchar **args, int start, GList *keys, gboolean *res)
GList *found_keys = NULL;
for (curr = start; curr < g_strv_length(args); curr+= 2) {
// check if option valid
if (g_list_find(keys, args[curr]) == NULL) {
if (g_list_find_custom(keys, args[curr], (GCompareFunc)g_strcmp0) == NULL) {
*res = FALSE;
return options;
}
// check if duplicate
if (g_list_find(found_keys, args[curr]) != NULL) {
if (g_list_find_custom(found_keys, args[curr], (GCompareFunc)g_strcmp0) != NULL) {
*res = FALSE;
return options;
}