Thread (9 messages) flat view 9 messages, 2 authors, 2020-05-18

Re: [RFC PATCH v2] t4210: detect REG_ILLSEQ dynamically

From: Eric Sunshine <hidden>
Date: 2020-05-13 20:40:23

On Wed, May 13, 2020 at 2:02 PM Carlo Marcelo Arenas Belón
[off-list ref] wrote:
[...]
The description of the first test which wasn't accurate has been corrected,
and unlike the original fix from 7187c7bbb8, all added entries to test-lib
are no longer needed and only the 2 affected engines will have their tests
suppressed.
I see this paragraph was updated in response to my question about why
those additional test-lib.sh variable assignments were being dropped
by the patch. However, this explanation gives no actual detail about
why those assignments are unneeded, thus their removal is just as much
of a head-scratcher as was v1 in which the commit message did not talk
about them at all.
quoted hunk ↗ jump to hunk
Signed-off-by: Carlo Marcelo Arenas Belón <redacted>
---
@@ -41,16 +41,21 @@ int cmd__regex(int argc, const char **argv)
+       ret = regcomp(&r, pat, flags);
+       if (ret) {
+               if (!silent) {
+                       regerror(ret, &r, errbuf, sizeof(errbuf));
+                       die("failed regcomp() for pattern '%s' (%s)",
+                               pat, errbuf);
+               } else
+                       return 1;
+       }
This is pure nit, and I wouldn't necessarily want to see a re-roll
just for this, but you could lose an indentation level and make the
code a bit easier to grok by structuring it like this:

    if (ret) {
        if (silent)
            return 1;
        regerror(...);
        die(...);
    }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help