FORALL_ACTIVE_TERM_OUTPUTS macro

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-12-24 17:51:43 +01:00
parent 8eca55a6eb
commit 3be7f8de12
8 changed files with 106 additions and 121 deletions

View file

@ -363,21 +363,19 @@ grub_cmdline_get (const char *prompt)
struct cmdline_term *cl_term_cur;
struct grub_term_output *cur;
nterms = 0;
for (cur = grub_term_outputs; cur; cur = cur->next)
if (grub_term_is_active (cur))
nterms++;
FOR_ACTIVE_TERM_OUTPUTS(cur)
nterms++;
cl_terms = grub_malloc (sizeof (cl_terms[0]) * nterms);
if (!cl_terms)
return 0;
cl_term_cur = cl_terms;
for (cur = grub_term_outputs; cur; cur = cur->next)
if (grub_term_is_active (cur))
{
cl_term_cur->term = cur;
init_clterm (cl_term_cur);
cl_term_cur++;
}
FOR_ACTIVE_TERM_OUTPUTS(cur)
{
cl_term_cur->term = cur;
init_clterm (cl_term_cur);
cl_term_cur++;
}
}
if (hist_used == 0)