From 2d184134b0ac47f42d70cf1c9fa80cbb5964f828 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 10 Jul 2013 10:33:19 +0000 Subject: [PATCH] fix: infinite loop if option was given --- src/peerinfo-tool/gnunet-peerinfo.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 34262aa6d..ba311dced 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -144,6 +144,11 @@ static int get_self; */ static int get_uri; +/** + * Option + */ +static int default_operation; + /** * Option '-i' */ @@ -730,6 +735,7 @@ state_machine (void *cls, printf ("%s\n", (char *) &enc); else printf (_("I am peer `%s'.\n"), (const char *) &enc); + } else if (GNUNET_YES == get_uri) { @@ -745,9 +751,10 @@ state_machine (void *cls, TIMEOUT, &dump_my_hello, NULL); return; } - else + else if (GNUNET_YES == default_operation) { /* default operation list all */ + default_operation = GNUNET_NO; get_info = GNUNET_YES; tt = GNUNET_SCHEDULER_add_now (&state_machine, NULL); return; @@ -768,6 +775,7 @@ state_machine (void *cls, int main (int argc, char *const *argv) { + default_operation = GNUNET_YES; static const struct GNUNET_GETOPT_CommandLineOption options[] = { {'n', "numeric", NULL, gettext_noop ("don't resolve host names"), -- 2.25.1