]> git.wh0rd.org - fontconfig.git/commitdiff
Fix grep pattern in makealias to work on non-Gnu grep (bug 8368).
authorKeith Packard <keithp@neko.keithp.com>
Sat, 2 Dec 2006 21:14:23 +0000 (13:14 -0800)
committerKeith Packard <keithp@neko.keithp.com>
Sat, 2 Dec 2006 21:14:23 +0000 (13:14 -0800)
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

index 02167b25bdf1cfda21b0839c42fd661d3e3a8214..ef4d3c297c23375b453cf4cf873e90b0536c2262 100755 (executable)
@@ -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