From a1cfd09079990ad9be0be45cb48be363dfc10e54 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 31 Jan 2019 22:42:12 -0600 Subject: Sed assumed FLAG(r) was 1 but didn't document it above the NEWTOY line. (oops) --- toys/posix/sed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys/posix/sed.c') diff --git a/toys/posix/sed.c b/toys/posix/sed.c index e111467b..228055f9 100644 --- a/toys/posix/sed.c +++ b/toys/posix/sed.c @@ -788,7 +788,7 @@ static void parse_pattern(char **pline, long len) if (!(s = unescape_delimited_string(&line, 0))) goto error; if (!*s) command->rmatch[i] = 0; else { - xregcomp((void *)reg, s, FLAG(r)*REG_EXTENDED); + xregcomp((void *)reg, s, REG_EXTENDED*!!FLAG(r)); command->rmatch[i] = reg-toybuf; reg += sizeof(regex_t); } @@ -882,7 +882,7 @@ resume_s: // allocating the space was done by extend_string() above if (!*TT.remember) command->arg1 = 0; else xregcomp((void *)(command->arg1 + (char *)command), TT.remember, - (FLAG(r)*REG_EXTENDED)|((command->sflags&1)*REG_ICASE)); + (REG_EXTENDED*!!FLAG(r))|((command->sflags&1)*REG_ICASE)); free(TT.remember); TT.remember = 0; if (*line == 'w') { -- cgit v1.2.3