From: Ramkumar Ramachandra Date: Sun, 14 Aug 2011 14:07:20 GMT Subject: Re: [PATCH 2/7] revert: Fix buffer overflow in insn sheet parser Message-ID: In-Reply-To: <20110814115821.GC18466@elie.gateway.2wire.net> Hi Jonathan, Jonathan Nieder writes: > Ramkumar Ramachandra wrote: >> --- a/t/t3510-cherry-pick-sequence.sh >> +++ b/t/t3510-cherry-pick-sequence.sh >> @@ -211,4 +211,15 @@ test_expect_success 'malformed instruction sheet 2' ' >> [...] >> +     sed "s/pick \([0-9a-f]\+\)\(.*\)/pick \1\1\1\1\1\1\1\1\2/" .git/sequencer/todo >new_sheet && > > This construct (\+ in sed regexes) is not portable.  See the note on > grep in Documentation/CodingGuidelines I see. Could you show me how to do it right? My regex-foo is pretty weak, and I don't know what else to do. > (maybe it should be tweaked to > say "grep and sed"). Okay. Do you like this? Signed-off-by: Ramkumar Ramachandra -- 8< -- diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index fe1c1e5..0a843ea 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -69,8 +69,8 @@ For shell scripts specifically (not exhaustive): - We do not write the noiseword "function" in front of shell functions. - - As to use of grep, stick to a subset of BRE (namely, no \{m,n\}, - [::], [==], nor [..]) for portability. + - As to use of grep and sed, stick to a subset of BRE (namely, no + \{m,n\}, [::], [==], nor [..]) for portability. - We do not use \{m,n\}; -- Ram