~skeeto/public-inbox

1

[PATCH v2][u-config] Fix outputting error due to stale proc->err

Details
Message ID
<gi2unvw6epn3u6mcm5ildytt2szvgp7rkbkvup4kk3yrqawspi@ef5kxcrbqqbj>
Sender timestamp
1742015929
DKIM signature
pass
Download raw message
Patch: +11 -2
This used to work up until v0.32.0 but regressed during the
style rewrite at: c4917c1a54f4ee51638d45090836fff0055d3c8d
---
 test_main.c | 9 +++++++++
 u-config.c  | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/test_main.c b/test_main.c
index 42db89f..162ee92 100644
--- a/test_main.c
+++ b/test_main.c
@@ -740,6 +740,15 @@ static void test_error_messages(void)
        "x = -I\"\n"
    ));

    SHOULDFAIL { // should be silent
        run(conf, S("--exists"), S("nonexistingpkg"), E);
    }
    EXPECT("");
    SHOULDFAIL {
        run(conf, S("--atleast-version"), S("9"), S("nonexistingpkg"), E);
    }
    EXPECT("");

    SHOULDFAIL {
        run(conf, S("--cflags"), S("nonexistingpkg"), E);
    }
diff --git a/u-config.c b/u-config.c
index ea73990..7540f71 100644
--- a/u-config.c
+++ b/u-config.c
@@ -2004,11 +2004,11 @@ static void uconfig(config *conf)
    }

    if (err_to_stdout) {
        err = out;
        proc->err = err = out;
    }

    if (silent) {
        err = newnullout(perm);
        proc->err = err = newnullout(perm);
    }

    pkgspec *specs = parsespecs(args, nargs, 0, err, perm);
-- 
2.48.1
Details
Message ID
<20250315165806.d4tzp5tcglfhdd7g@nullprogram.com>
In-Reply-To
<gi2unvw6epn3u6mcm5ildytt2szvgp7rkbkvup4kk3yrqawspi@ef5kxcrbqqbj> (view parent)
Sender timestamp
1742043486
DKIM signature
missing
Download raw message
Merged as 3b28a8f0! Thanks for the tests, too.
Reply to thread Export thread (mbox)