From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id DAF1B3858D39; Wed, 2 Mar 2022 21:15:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAF1B3858D39 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: getconf: align -a output to glibc getconf X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: fcec4830abf0aa4821ba1a5dd1d9fb35d671cb85 X-Git-Newrev: 35ba7d147df8df56ef92ea296443d2732ece0445 Message-Id: <20220302211511.DAF1B3858D39@sourceware.org> Date: Wed, 2 Mar 2022 21:15:11 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2022 21:15:12 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D35ba7d147df= 8df56ef92ea296443d2732ece0445 commit 35ba7d147df8df56ef92ea296443d2732ece0445 Author: Corinna Vinschen Date: Wed Mar 2 22:15:02 2022 +0100 Cygwin: getconf: align -a output to glibc getconf =20 glibc getconf doesn't print "undefined" for undefined values in -a output. It just prints the empty string. Do it the same way. =20 Signed-off-by: Corinna Vinschen 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 *p= athname) { if (a_flag && errno !=3D 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 *p= athname) { if (a_flag && errno !=3D 0) return; /* Just skip invalid variables */ - print_strvar (cp->name, "undefined"); + print_strvar (cp->name, a_flag ? "" : "undefined"); } else print_longvar (cp->name, val);