public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: getconf: align -a output to glibc getconf
Date: Wed,  2 Mar 2022 21:15:11 +0000 (GMT)	[thread overview]
Message-ID: <20220302211511.DAF1B3858D39@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=35ba7d147df8df56ef92ea296443d2732ece0445

commit 35ba7d147df8df56ef92ea296443d2732ece0445
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Mar 2 22:15:02 2022 +0100

    Cygwin: getconf: align -a output to glibc getconf
    
    glibc getconf doesn't print "undefined" for undefined values
    in -a output.  It just prints the empty string.  Do it the
    same way.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/getconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index bc37bfb47..88deddd38 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -481,7 +481,7 @@ printvar (const struct conf_variable *cp, const char *pathname)
 	{
 	  if (a_flag && errno != 0)
 	    return; /* Just skip invalid variables */
-	  print_strvar (cp->name, "undefined");
+	  print_strvar (cp->name, a_flag ? "" : "undefined");
 	}
       else
 	print_longvar (cp->name, val);
@@ -493,7 +493,7 @@ printvar (const struct conf_variable *cp, const char *pathname)
 	{
 	  if (a_flag && errno != 0)
 	    return; /* Just skip invalid variables */
-	  print_strvar (cp->name, "undefined");
+	  print_strvar (cp->name, a_flag ? "" : "undefined");
 	}
       else
 	print_longvar (cp->name, val);


                 reply	other threads:[~2022-03-02 21:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220302211511.DAF1B3858D39@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).