Skip to content
Prev 31123 / 63421 Next

patch for src/main/character.c

Attached is a suggested patch for src/main/character.c.  It does not fix
a bug, but rather provides an improvement on the recent extension of
do_grep.

In essence, instead of four occurences of 'invert ^ LOGICAL(ind)[i]'
that accommodate for the option 'invert' added to grep, there is one
occurence of 'LOGICAL(ind)[i] ^= invert' that modifies in-place the
logical vector of matched/unmatched flags.  Having the inversion done in
just one place instead of four locations in the code should make it
simpler to understand, maintain, and further extend the code.

The patch was made based on the src/main/character.c file in
R-devel_2009-01-20.  Patched code was successfully compiled and tested
on 32bit Ubuntu 8.04.

Regards,
Wacek