Re: [PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-07 Thread Masahiro Yamada
2018-02-08 8:34 GMT+09:00 Ulf Magnusson :
> On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada
>  wrote:
>> If stdout is redirected to a file, prompts look differently due to
>> missing new lines.
>>
>> Currently, conf_askvalue() takes care of this by putting additional
>> new line, but conf_choice() does not.  Do likewise so that prompts
>> after 'choice' look properly.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  scripts/kconfig/conf.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
>> index d346642..6ce06c8 100644
>> --- a/scripts/kconfig/conf.c
>> +++ b/scripts/kconfig/conf.c
>> @@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
>> case oldaskconfig:
>> fflush(stdout);
>> xfgets(line, sizeof(line), stdin);
>> +   if (!tty_stdio)
>> +   printf("\n");
>> strip(line);
>> if (line[0] == '?') {
>> print_help(menu);
>> --
>> 2.7.4
>>
>
> Reviewed-by: Ulf Magnusson 
>
> Maybe this could be moved into the xfgets() function as well.
>

Thanks for your comment!
Yes, it is better to move this into xfgets().

I improve this a bit more so that the redirected stdout
contains not only '\n' but also input keys.

https://patchwork.kernel.org/patch/10206611/


-- 
Best Regards
Masahiro Yamada


Re: [PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-07 Thread Masahiro Yamada
2018-02-08 8:34 GMT+09:00 Ulf Magnusson :
> On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada
>  wrote:
>> If stdout is redirected to a file, prompts look differently due to
>> missing new lines.
>>
>> Currently, conf_askvalue() takes care of this by putting additional
>> new line, but conf_choice() does not.  Do likewise so that prompts
>> after 'choice' look properly.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  scripts/kconfig/conf.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
>> index d346642..6ce06c8 100644
>> --- a/scripts/kconfig/conf.c
>> +++ b/scripts/kconfig/conf.c
>> @@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
>> case oldaskconfig:
>> fflush(stdout);
>> xfgets(line, sizeof(line), stdin);
>> +   if (!tty_stdio)
>> +   printf("\n");
>> strip(line);
>> if (line[0] == '?') {
>> print_help(menu);
>> --
>> 2.7.4
>>
>
> Reviewed-by: Ulf Magnusson 
>
> Maybe this could be moved into the xfgets() function as well.
>

Thanks for your comment!
Yes, it is better to move this into xfgets().

I improve this a bit more so that the redirected stdout
contains not only '\n' but also input keys.

https://patchwork.kernel.org/patch/10206611/


-- 
Best Regards
Masahiro Yamada


Re: [PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-07 Thread Ulf Magnusson
On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada
 wrote:
> If stdout is redirected to a file, prompts look differently due to
> missing new lines.
>
> Currently, conf_askvalue() takes care of this by putting additional
> new line, but conf_choice() does not.  Do likewise so that prompts
> after 'choice' look properly.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  scripts/kconfig/conf.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index d346642..6ce06c8 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
> case oldaskconfig:
> fflush(stdout);
> xfgets(line, sizeof(line), stdin);
> +   if (!tty_stdio)
> +   printf("\n");
> strip(line);
> if (line[0] == '?') {
> print_help(menu);
> --
> 2.7.4
>

Reviewed-by: Ulf Magnusson 

Maybe this could be moved into the xfgets() function as well.

Cheers,
Ulf


Re: [PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-07 Thread Ulf Magnusson
On Tue, Feb 6, 2018 at 1:34 AM, Masahiro Yamada
 wrote:
> If stdout is redirected to a file, prompts look differently due to
> missing new lines.
>
> Currently, conf_askvalue() takes care of this by putting additional
> new line, but conf_choice() does not.  Do likewise so that prompts
> after 'choice' look properly.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  scripts/kconfig/conf.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index d346642..6ce06c8 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
> case oldaskconfig:
> fflush(stdout);
> xfgets(line, sizeof(line), stdin);
> +   if (!tty_stdio)
> +   printf("\n");
> strip(line);
> if (line[0] == '?') {
> print_help(menu);
> --
> 2.7.4
>

Reviewed-by: Ulf Magnusson 

Maybe this could be moved into the xfgets() function as well.

Cheers,
Ulf


[PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-05 Thread Masahiro Yamada
If stdout is redirected to a file, prompts look differently due to
missing new lines.

Currently, conf_askvalue() takes care of this by putting additional
new line, but conf_choice() does not.  Do likewise so that prompts
after 'choice' look properly.

Signed-off-by: Masahiro Yamada 
---

 scripts/kconfig/conf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index d346642..6ce06c8 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
case oldaskconfig:
fflush(stdout);
xfgets(line, sizeof(line), stdin);
+   if (!tty_stdio)
+   printf("\n");
strip(line);
if (line[0] == '?') {
print_help(menu);
-- 
2.7.4



[PATCH 04/14] kconfig: print additional new line for choice for redirection

2018-02-05 Thread Masahiro Yamada
If stdout is redirected to a file, prompts look differently due to
missing new lines.

Currently, conf_askvalue() takes care of this by putting additional
new line, but conf_choice() does not.  Do likewise so that prompts
after 'choice' look properly.

Signed-off-by: Masahiro Yamada 
---

 scripts/kconfig/conf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index d346642..6ce06c8 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -317,6 +317,8 @@ static int conf_choice(struct menu *menu)
case oldaskconfig:
fflush(stdout);
xfgets(line, sizeof(line), stdin);
+   if (!tty_stdio)
+   printf("\n");
strip(line);
if (line[0] == '?') {
print_help(menu);
-- 
2.7.4