Re: [PATCH 2/7] revert: Fix buffer overflow in insn sheet parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <artagnon@xxxxxxxxx>
-- 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]