From 5e234d9e764d8c52d93b918a5c92b7956c95882b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 2 Dec 2006 13:14:23 -0800 Subject: [PATCH] Fix grep pattern in makealias to work on non-Gnu grep (bug 8368). grep -l -w '^foo' doesn't work on Solaris. Replace with grep -l '^foo\>' instead which does. Also, grep -l will report the filename more than once (!), so add | head -1 to pick just the first one. --- src/makealias | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/makealias b/src/makealias index 02167b2..ef4d3c2 100755 --- a/src/makealias +++ b/src/makealias @@ -15,7 +15,7 @@ while read name; do hattr='__attribute((visibility("hidden")))' echo "extern __typeof ($name) $alias $hattr;" >> $HEAD echo "#define $name $alias" >> $HEAD - grep -l -w '^'$name "$SRCDIR"/*.c | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL + grep -l '^'$name'\>' "$SRCDIR"/*.c | head -1 | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL echo "#undef $name" >> $TAIL cattr='__attribute((alias("'$alias'"), visibility("default")))' echo "extern __typeof ($name) $name $cattr;" >> $TAIL -- 2.39.5