From e96fe301fad3720a3ab2c87412d46e36643b00ff Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 20 Oct 2004 06:04:18 +0000 Subject: [PATCH] Don't return the wrong change. (#155856, Lucas Rocha) 2004-10-20 Matthias Clasen * glib/goption.c (get_change): Don't return the wrong change. (#155856, Lucas Rocha) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/goption.c | 17 ++++++++--------- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00de45d..ba58798 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-20 Matthias Clasen + + * glib/goption.c (get_change): Don't return the wrong + change. (#155856, Lucas Rocha) + 2004-10-17 Matthias Clasen * glib/gutils.h (G_IS_DIR_SEPARATOR): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 00de45d..ba58798 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-10-20 Matthias Clasen + + * glib/goption.c (get_change): Don't return the wrong + change. (#155856, Lucas Rocha) + 2004-10-17 Matthias Clasen * glib/gutils.h (G_IS_DIR_SEPARATOR): diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 00de45d..ba58798 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2004-10-20 Matthias Clasen + + * glib/goption.c (get_change): Don't return the wrong + change. (#155856, Lucas Rocha) + 2004-10-17 Matthias Clasen * glib/gutils.h (G_IS_DIR_SEPARATOR): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 00de45d..ba58798 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-10-20 Matthias Clasen + + * glib/goption.c (get_change): Don't return the wrong + change. (#155856, Lucas Rocha) + 2004-10-17 Matthias Clasen * glib/gutils.h (G_IS_DIR_SEPARATOR): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 00de45d..ba58798 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-10-20 Matthias Clasen + + * glib/goption.c (get_change): Don't return the wrong + change. (#155856, Lucas Rocha) + 2004-10-17 Matthias Clasen * glib/gutils.h (G_IS_DIR_SEPARATOR): diff --git a/glib/goption.c b/glib/goption.c index 8001bad..9efb318 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -428,18 +428,17 @@ get_change (GOptionContext *context, change = list->data; if (change->arg_data == arg_data) - break; + goto found; } - if (!change) - { - change = g_new0 (Change, 1); - change->arg_type = arg_type; - change->arg_data = arg_data; - - context->changes = g_list_prepend (context->changes, change); - } + change = g_new0 (Change, 1); + change->arg_type = arg_type; + change->arg_data = arg_data; + + context->changes = g_list_prepend (context->changes, change); + found: + return change; } -- 2.7.4