[PATCH 2/2] rework menu so that it can support multiline titles

Aleksey Kuleshov rndfax at yandex.ru
Thu Aug 18 04:24:17 PDT 2016


>>  + for (src = tmp, i = 0; i < lines; i++) {
>>  + if (parser)
>>  + m->display[i] = parser(src);
>>  + else
>>  + m->display[i] = xstrdup(src);
>
> What's the reason for running parser() over the separated strings? Can't
> you run parser() over the original multiline string instead?

For example, shell_expand removes '\n' from the string making it just ' ' (space).
So, to not lose this information parser apllies to every single already expanded string.

But with new patch I'm working on this will be unnecessary.
menu_add_title will do only one thing: adding the title (which can be miltilined) and nothing else.



More information about the barebox mailing list