--- src/cli/report.c | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index f2c2380..7da3c24 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -745,30 +745,37 @@ int report(const char *dump_dir_name, int flags) else { const char *rating_str = get_crash_item_content_or_NULL(crash_data, FILENAME_RATING); - unsigned rating = rating_str ? xatou(rating_str) : 4; + unsigned i, rating = rating_str ? xatou(rating_str) : 4; + GList *li; + char wanted_reporters[255];
- /* For every reporter, ask if user really wants to report using it. */ - for (GList *li = report_events; li; li = li->next) + puts(_("Available reporters:")); + /* Print list of reporters and ask the user which should be used. */ + for (li = report_events, i = 1; li; li = li->next, i++) { char *reporter_name = (char *) li->data; event_config_t *config = get_event_config(reporter_name); - char question[255]; - char *show_reporter_name; - if (config) - show_reporter_name = (config->screen_name) ? config->screen_name : reporter_name; - else - show_reporter_name = reporter_name;
- snprintf(question, sizeof(question), _("Report using %s?"), show_reporter_name); + printf("%d) %s\n", i, (config && config->screen_name) ? config->screen_name : reporter_name); + } + + read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters)); + + for (li = report_events, i = 1; li; li = li->next, i++) + { + char *reporter_name = (char *) li->data; + event_config_t *config = get_event_config(reporter_name); + char reporter_number[10], *c; + int len;
if (!config) VERB1 log("No configuration file found for '%s' reporter", reporter_name); - - if (!ask_yesno(question)) - { - puts(_("Skipping...")); + + /* Was this reporter requested? */ + len = snprintf(reporter_number, sizeof(reporter_number), "%d", i); + c = strstr(wanted_reporters, reporter_number); + if (!(c && (c == wanted_reporters || !isdigit(c[-1])) && (!c[len] || !isdigit(c[len])))) continue; - }
/* TODO: npajkovs; not implemented yet */ //const char *rating_required = get_map_string_item_or_NULL(single_plugin_settings, "RatingRequired");
--- src/cli/report.c | 41 ++++++++++++++++++++++++++--------------- 1 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index f2c2380..1e2eec9 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -745,30 +745,41 @@ int report(const char *dump_dir_name, int flags) else { const char *rating_str = get_crash_item_content_or_NULL(crash_data, FILENAME_RATING); - unsigned rating = rating_str ? xatou(rating_str) : 4; + unsigned i, rating = rating_str ? xatou(rating_str) : 4; + GList *li; + char wanted_reporters[255];
- /* For every reporter, ask if user really wants to report using it. */ - for (GList *li = report_events; li; li = li->next) + puts(_("Available reporters:")); + /* Print list of reporters and ask the user which should be used. */ + for (li = report_events, i = 1; li; li = li->next, i++) { char *reporter_name = (char *) li->data; event_config_t *config = get_event_config(reporter_name); - char question[255]; - char *show_reporter_name; - if (config) - show_reporter_name = (config->screen_name) ? config->screen_name : reporter_name; - else - show_reporter_name = reporter_name;
- snprintf(question, sizeof(question), _("Report using %s?"), show_reporter_name); + printf("%d) %s\n", i, (config && config->screen_name) ? config->screen_name : reporter_name); + } + + read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters)); + + for (li = report_events, i = 1; li; li = li->next, i++) + { + char *reporter_name = (char *) li->data; + event_config_t *config = get_event_config(reporter_name); + char reporter_number[10], *c; + int len;
if (!config) VERB1 log("No configuration file found for '%s' reporter", reporter_name); - - if (!ask_yesno(question)) - { - puts(_("Skipping...")); - continue; + + /* Was this reporter requested? */ + len = snprintf(reporter_number, sizeof(reporter_number), "%d", i); + for (c = wanted_reporters; *c; c++) { + c = strstr(c, reporter_number); + if (!c || ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len]))) + break; } + if (!c || !*c) + continue;
/* TODO: npajkovs; not implemented yet */ //const char *rating_required = get_map_string_item_or_NULL(single_plugin_settings, "RatingRequired");
--- src/cli/report.c | 41 ++++++++++++++++++++++++++--------------- 1 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index f2c2380..a3dd18a 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -745,30 +745,41 @@ int report(const char *dump_dir_name, int flags) else { const char *rating_str = get_crash_item_content_or_NULL(crash_data, FILENAME_RATING); - unsigned rating = rating_str ? xatou(rating_str) : 4; + unsigned i, rating = rating_str ? xatou(rating_str) : 4; + GList *li; + char wanted_reporters[255];
- /* For every reporter, ask if user really wants to report using it. */ - for (GList *li = report_events; li; li = li->next) + puts(_("How would you like to report the problem?")); + /* Print list of reporters and ask the user which should be used. */ + for (li = report_events, i = 1; li; li = li->next, i++) { char *reporter_name = (char *) li->data; event_config_t *config = get_event_config(reporter_name); - char question[255]; - char *show_reporter_name; - if (config) - show_reporter_name = (config->screen_name) ? config->screen_name : reporter_name; - else - show_reporter_name = reporter_name;
- snprintf(question, sizeof(question), _("Report using %s?"), show_reporter_name); + printf(" %d) %s\n", i, (config && config->screen_name) ? config->screen_name : reporter_name); + } + + read_from_stdin(_("Select reporter(s): "), wanted_reporters, sizeof(wanted_reporters)); + + for (li = report_events, i = 1; li; li = li->next, i++) + { + char *reporter_name = (char *) li->data; + event_config_t *config = get_event_config(reporter_name); + char reporter_number[10], *c; + int len;
if (!config) VERB1 log("No configuration file found for '%s' reporter", reporter_name); - - if (!ask_yesno(question)) - { - puts(_("Skipping...")); - continue; + + /* Was this reporter requested? */ + len = snprintf(reporter_number, sizeof(reporter_number), "%d", i); + for (c = wanted_reporters; *c; c++) { + c = strstr(c, reporter_number); + if (!c || ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len]))) + break; } + if (!c || !*c) + continue;
/* TODO: npajkovs; not implemented yet */ //const char *rating_required = get_map_string_item_or_NULL(single_plugin_settings, "RatingRequired");
--- src/cli/report.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index a3dd18a..e99ea34 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -586,7 +586,7 @@ char *select_event_option(GList *list_options)
unsigned count = g_list_length(list_options) - 1; if (!count) - return NULL; + return xstrdup((char*)list_options->data);
int pos = -1; fprintf(stdout, _("Select how you would like to analyze the problem:\n"));
Miroslav Lichvar mlichvar@redhat.com writes:
src/cli/report.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index a3dd18a..e99ea34 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -586,7 +586,7 @@ char *select_event_option(GList *list_options)
unsigned count = g_list_length(list_options) - 1;
This need to be fixed. We must not subtract -1 right now.
if (!count)
return NULL;
return xstrdup((char*)list_options->data);
g_list_length returns 0 only if list_options is NULL and we check it before.
Problem is in function report. see
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result = run_analyze_event(dump_dir_name, event); if NULL it sigsegv ^^^ free(event); ...
Need to be checked before
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result; if (event) analyzer_result = run_analyze_event(dump_dir_name, event); free(event); ...
int pos = -1; fprintf(stdout, _("Select how you would like to analyze the problem:\n"));
On Wed, Apr 27, 2011 at 03:26:46PM +0200, Nikola Pajkovsky wrote:
Miroslav Lichvar mlichvar@redhat.com writes:
src/cli/report.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index a3dd18a..e99ea34 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -586,7 +586,7 @@ char *select_event_option(GList *list_options)
unsigned count = g_list_length(list_options) - 1;
This need to be fixed. We must not subtract -1 right now.
That's addressed in the 3/3 patch.
if (!count)
return NULL;
return xstrdup((char*)list_options->data);
g_list_length returns 0 only if list_options is NULL and we check it before.
If there is only one reporter, I think we want to select it without asking the user, or not?
Problem is in function report. see
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result = run_analyze_event(dump_dir_name, event); if NULL it sigsegv ^^^ free(event);
...
Need to be checked before
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result; if (event) analyzer_result = run_analyze_event(dump_dir_name, event); free(event);
...
int pos = -1; fprintf(stdout, _("Select how you would like to analyze the problem:\n"));
Agreed, but that should be another patch.
Miroslav Lichvar mlichvar@redhat.com writes:
On Wed, Apr 27, 2011 at 03:26:46PM +0200, Nikola Pajkovsky wrote:
Miroslav Lichvar mlichvar@redhat.com writes:
src/cli/report.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index a3dd18a..e99ea34 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -586,7 +586,7 @@ char *select_event_option(GList *list_options)
unsigned count = g_list_length(list_options) - 1;
This need to be fixed. We must not subtract -1 right now.
That's addressed in the 3/3 patch.
ok
if (!count)
return NULL;
return xstrdup((char*)list_options->data);
g_list_length returns 0 only if list_options is NULL and we check it before.
If there is only one reporter, I think we want to select it without asking the user, or not?
Problem is in function report. see
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result = run_analyze_event(dump_dir_name, event); if NULL it sigsegv ^^^ free(event);
...
Need to be checked before
... char *event = select_event_option(list_analyze_events); list_free_with_free(list_analyze_events);
int analyzer_result; if (event) analyzer_result = run_analyze_event(dump_dir_name, event); free(event);
...
int pos = -1; fprintf(stdout, _("Select how you would like to analyze the problem:\n"));
Agreed, but that should be another patch.
nope, this patch fix only one part of problem, so why not fix the other one?
--- src/cli/report.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/cli/report.c b/src/cli/report.c index e99ea34..1b90aed 100644 --- a/src/cli/report.c +++ b/src/cli/report.c @@ -584,12 +584,12 @@ char *select_event_option(GList *list_options) if (!list_options) return NULL;
- unsigned count = g_list_length(list_options) - 1; - if (!count) + unsigned count = g_list_length(list_options); + if (count == 1) return xstrdup((char*)list_options->data);
- int pos = -1; - fprintf(stdout, _("Select how you would like to analyze the problem:\n")); + int pos = 0; + fprintf(stdout, _("How you would like to analyze the problem?\n")); for (GList *li = list_options; li; li = li->next) { char *opt = (char*)li->data; @@ -605,14 +605,9 @@ char *select_event_option(GList *list_options) unsigned ii; for (ii = 0; ii < 3; ++ii) { - fprintf(stdout, _("Choose option [0 - %u]: "), count); - fflush(NULL); - char answer[16]; - if (!fgets(answer, sizeof(answer), stdin)) - continue;
- answer[strlen(answer) - 1] = '\0'; + read_from_stdin(_("Select analyzer: "), answer, sizeof(answer)); if (!*answer) continue;
@@ -620,6 +615,7 @@ char *select_event_option(GList *list_options) if (picked > count) { fprintf(stdout, _("You have chosen number out of range")); + fprintf(stdout, "\n"); continue; }
@@ -629,7 +625,7 @@ char *select_event_option(GList *list_options) if (ii == 3) error_msg_and_die(_("Invalid input, program exiting..."));
- GList *choosen = g_list_nth(list_options, picked); + GList *choosen = g_list_nth(list_options, picked - 1); return xstrdup((char*)choosen->data); }
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Denys Vlasenko dvlasenk@redhat.com writes:
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Massive NACK.
We could let users to put selected reporters into list separated by space. Then there is a nice function GList *str_to_glist(char *str, int delim) to parse list. Check what is selected and what reporters are actually printed out is piece of cake.
On Wed, Apr 27, 2011 at 03:43:39PM +0200, Nikola Pajkovsky wrote:
Denys Vlasenko dvlasenk@redhat.com writes:
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1])) && !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Massive NACK.
We could let users to put selected reporters into list separated by space. Then there is a nice function GList *str_to_glist(char *str, int delim) to parse list. Check what is selected and what reporters are actually printed out is piece of cake.
Not sure I understand. You are proposing to create a list of strings from the string entered by the user and then compare the two (unsorted) lists?
On 04/27/2011 04:58 PM, Miroslav Lichvar wrote:
On Wed, Apr 27, 2011 at 03:43:39PM +0200, Nikola Pajkovsky wrote:
Denys Vlasenkodvlasenk@redhat.com writes:
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Massive NACK.
We could let users to put selected reporters into list separated by space. Then there is a nice function GList *str_to_glist(char *str, int delim) to parse list. Check what is selected and what reporters are actually printed out is piece of cake.
- so you're proposing to force users to write "Bugzilla, Logger" instead of "1, 2" ?? And how is that better?
Not sure I understand. You are proposing to create a list of strings from the string entered by the user and then compare the two (unsorted) lists?
- I agree with Mirek's solution as it has been approved earlier. Nikola couldn't know that because he wasn't here when we discussed it so that's why he might be confused.
Jiri Moskovcak jmoskovc@redhat.com writes:
On 04/27/2011 04:58 PM, Miroslav Lichvar wrote:
On Wed, Apr 27, 2011 at 03:43:39PM +0200, Nikola Pajkovsky wrote:
Denys Vlasenkodvlasenk@redhat.com writes:
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Massive NACK.
We could let users to put selected reporters into list separated by space. Then there is a nice function GList *str_to_glist(char *str, int delim) to parse list. Check what is selected and what reporters are actually printed out is piece of cake.
- so you're proposing to force users to write "Bugzilla, Logger" instead
of "1, 2" ?? And how is that better?
Of course the numbers! I wanted propose better solution than the ugly for cycle.
Not sure I understand. You are proposing to create a list of strings from the string entered by the user and then compare the two (unsorted) lists?
- I agree with Mirek's solution as it has been approved earlier. Nikola
couldn't know that because he wasn't here when we discussed it so that's why he might be confused.
put me into picture
On 04/28/2011 08:26 AM, Nikola Pajkovsky wrote:
Jiri Moskovcakjmoskovc@redhat.com writes:
On 04/27/2011 04:58 PM, Miroslav Lichvar wrote:
On Wed, Apr 27, 2011 at 03:43:39PM +0200, Nikola Pajkovsky wrote:
Denys Vlasenkodvlasenk@redhat.com writes:
On Mon, 2011-04-18 at 14:44 +0200, Miroslav Lichvar wrote:
unsigned rating = rating_str ? xatou(rating_str) : 4;
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
This looks like a step back to me (wrt readability). I suggest putting these two variables on two separate lines.
char reporter_number[10], *c;
I suggest "reporter_number[sizeof(int)*3 + 2]" instead.
...
read_from_stdin(_("Which reporter(s) do you want to use? "), wanted_reporters, sizeof(wanted_reporters));
...
/* Was this reporter requested? */
len = snprintf(reporter_number, sizeof(reporter_number), "%d", i);
for (c = wanted_reporters; *c; c++) {
^^^^^^^^^^^^^ style violation
c = strstr(c, reporter_number);
if (!c || ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])))
break; }
if (!c || !*c)
continue;
This code is sufficiently obscure to warrant comments. Such as:
/* For each reporter, we check whether its number is in user's response */ len = snprintf... for (c = wanted_reporters; *c; c++) { c = strstr(c, reporter_number); if (!c) break; /* no such number in user response at all */ if ((c == wanted_reporters || !isdigit(c[-1]))&& !isdigit(c[len])) break; /* we found exactly this number in user response */ /* the substring is inside some other number (example: "1" in "11"), * continue checking from the next position. */ } if (!c || !*c) continue; /* no such number in user response, skip this reporter */
Massive NACK.
We could let users to put selected reporters into list separated by space. Then there is a nice function GList *str_to_glist(char *str, int delim) to parse list. Check what is selected and what reporters are actually printed out is piece of cake.
- so you're proposing to force users to write "Bugzilla, Logger" instead
of "1, 2" ?? And how is that better?
Of course the numbers! I wanted propose better solution than the ugly for cycle.
Not sure I understand. You are proposing to create a list of strings from the string entered by the user and then compare the two (unsorted) lists?
- I agree with Mirek's solution as it has been approved earlier. Nikola
couldn't know that because he wasn't here when we discussed it so that's why he might be confused.
put me into picture
- just ignore the last part I misunderstood your last email.. Mirek's for cycle has one advantage that you can use any delimiter you want..
crash-catcher@lists.fedorahosted.org