On Sat, May 07, 2011 at 05:12:22PM -0500, Amit Kulkarni wrote:
> If you pull up $WRKSRC/cocci.ml, then you get to the possible root of the
> problem, see around line 485.
>
> egrep fails because it relies on \b which is not supported in BSD grep?
Good catch.
Below is a diff against stuarts port. I also tried a different one
using gegrep (from sysutils/ggrep) instead of egrep, and got the
same output from make regress in both cases.
Ciao,
Kili
diff -rNup ../coccinelle.orig/patches/patch-cocci_ml ./patches/patch-cocci_ml
--- ../coccinelle.orig/patches/patch-cocci_ml Thu May 5 21:06:44 2011
+++ ./patches/patch-cocci_ml Sun May 8 12:23:14 2011
@@ -1,6 +1,6 @@
$OpenBSD$
---- cocci.ml.orig Thu May 5 20:04:22 2011
-+++ cocci.ml Thu May 5 20:04:39 2011
+--- cocci.ml.orig Wed Apr 13 07:25:58 2011
++++ cocci.ml Sun May 8 12:23:12 2011
@@ -263,8 +263,8 @@ let show_or_not_diff2 cfile outfile =
let line =
@@ -12,3 +12,20 @@ $OpenBSD$
let xs =
let res = Common.cmd_to_list line in
match (!Flag.patch,res) with
+@@ -485,13 +485,13 @@ let worth_trying cfiles tokens =
+ let tokens = tokens +> List.map (fun s ->
+ match () with
+ | _ when s =~ "^[A-Za-z_][A-Za-z_0-9]*$" ->
+- "\\b" ^ s ^ "\\b"
++ "[[:<:]]" ^ s ^ "[[:>:]]"
+
+ | _ when s =~ "^[A-Za-z_]" ->
+- "\\b" ^ s
++ "[[:<:]]" ^ s
+
+ | _ when s =~ ".*[A-Za-z_]$" ->
+- s ^ "\\b"
++ s ^ "[[:>:]]"
+ | _ -> s
+
+ ) in