diff options
author | Rob Landley <rob@landley.net> | 2019-01-31 22:42:12 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-01-31 22:42:12 -0600 |
commit | a1cfd09079990ad9be0be45cb48be363dfc10e54 (patch) | |
tree | c78349d50391d0e414d2a0aff14bd1c0203ba477 /toys | |
parent | a242b5be0b486fb1137c45c87e2867aef2e1fcb3 (diff) | |
download | toybox-a1cfd09079990ad9be0be45cb48be363dfc10e54.tar.gz |
Sed assumed FLAG(r) was 1 but didn't document it above the NEWTOY line. (oops)
Diffstat (limited to 'toys')
-rw-r--r-- | toys/posix/sed.c | 4 |
1 files changed, 2 insertions, 2 deletions
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') { |