Received: by 10.223.176.5 with SMTP id f5csp1515027wra; Wed, 7 Feb 2018 22:02:38 -0800 (PST) X-Google-Smtp-Source: AH8x226O6HqdEbw2aF28tbY4tKbE2nsFVsP+fD7qdOKuxzhnNgi9U0Bzv9Wf6zKonLJnUyOwzS17 X-Received: by 10.98.111.137 with SMTP id k131mr5857108pfc.76.1518069757969; Wed, 07 Feb 2018 22:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518069757; cv=none; d=google.com; s=arc-20160816; b=DaxDm9aMdUJKiEFP73XFHazvFbEpHV0OcQVU5+v62skS9CEmdeHpB07ZqzRxXDIs3/ GqZ0SrBsqtWpzQC/IbIZO4A6C4/YvfWSeTmTLf5uSPeoOph2PBPj8PY2V+BCpOakYu/L GiZqFAyyPDqM8tg4gC1yG30NDQ5ZiL/kWJII6p/03bG1DVRJvybiAgBAJxOMuEHztxNn p3zdaFYlRnd+Js5is9Hf5Bxlh1qCgTIexjZ/pL6MMPYH6ObyrriVmo0H2vhAFEKcFOIW sIvTZDkVFBfOiQklgdBjCsqs0WocuPInJU408e/JSGBczvXGWqrfKUuxc06onaADIygX E2Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=IGhjm1XrIn9Iv1L/Thg9FttGt1ZWJhZ3bw11PEZDunU=; b=ARf6FxsyrBCS62W/CiO67zB1qz/sudOgOy0BPtaepnhybVp+yAovF5yVsOMw3Rj0Ue qMWsJs7bloqBEc0rrmi9pWjY1Tqycp0IiLrNrTHSn6yGGAknuiS68tGk5nJ04U5C1Cvo vMWWQrJbz2Hzl/nX0iyZLr0fRdDIymZKqnmY19cg6Jq1Ad6IY10N/y75y1+Ls1fy3wZE 5fS0AJKtEfS3A9y6SCyMOiYEBZ0MpSzy4ETbo3MYxxb4pG3GclW7XC4KgDR5UBE4TI0D e3Esiz7fiD6ofG0yjhIOK/T9fKjn8/XJXQ/oBz9pX1UqBBNid/9Bv12RsDVLqGide0HK 6Zpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hJgVthi5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si1984171pgr.290.2018.02.07.22.02.23; Wed, 07 Feb 2018 22:02:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hJgVthi5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948AbeBHGBq (ORCPT + 99 others); Thu, 8 Feb 2018 01:01:46 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:37646 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766AbeBHGBp (ORCPT ); Thu, 8 Feb 2018 01:01:45 -0500 Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com [209.85.217.169]) (authenticated) by conssluserg-03.nifty.com with ESMTP id w1861b9w018977; Thu, 8 Feb 2018 15:01:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w1861b9w018977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518069697; bh=IGhjm1XrIn9Iv1L/Thg9FttGt1ZWJhZ3bw11PEZDunU=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=hJgVthi5qTL4/AXHJt8Hj4/gtAgjaAgS5BC0sfB9gc1Mb3Lbrcu9J6Y3m2up47GPp OUZTHaU3RkkCqW/tts6wHwgL6p5lJIzg+FnVMFXYTE41U5h2SeeOy6DMS8jGwSIUJU wDTi0S/L7ZgmlZOGrlnvWgLFrWohlmi+97wdLDKL2/4ex5jAxoNz+ELjhAOqICAthD eIliUouZSfceVj+xM9+L/RbaRpTWd4qOpo19oYmfb9jd7aRgk8ut/E085EnAFaKXsW oHn0NA1tpVqCo/KHiOyDNq9pmQxKBM/z8nq/5+lkPgSaI3r21YvEGCTqcASJj69AqY wU2476+ZDF6FQ== X-Nifty-SrcIP: [209.85.217.169] Received: by mail-ua0-f169.google.com with SMTP id q8so2178661uae.4; Wed, 07 Feb 2018 22:01:37 -0800 (PST) X-Gm-Message-State: APf1xPD+2OGChVbid40P36E/DN3drE0sp81Y4ZybyTS/tYWgBclGpMX9 ORATd3DGEyp7y9/04vWbTKXlS0wGIrtEzlbUFPk= X-Received: by 10.176.89.9 with SMTP id n9mr568349uad.195.1518069696403; Wed, 07 Feb 2018 22:01:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.83.212 with HTTP; Wed, 7 Feb 2018 22:00:56 -0800 (PST) In-Reply-To: References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-5-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Thu, 8 Feb 2018 15:00:56 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/14] kconfig: print additional new line for choice for redirection To: Ulf Magnusson Cc: Linux Kbuild mailing list , Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Linus Torvalds , Linux Kernel Mailing List , Marc Herbert Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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