#!/bin/sh

if test "$1" = ""; then 
	echo Please supply a directory to diff with
	exit 1
fi

oldcwd=`pwd`
if ! cd $1; then
	exit 1
fi	
echo "Diffing all .c and .h files in $1 with CWD's versions..."

for i in `ls *.[ch]`; do
	STUFF=`diff $oldcwd/$i ./$i`
	if test "$STUFF" != ""; then
		if test "$2" = "--verbose"; then
			echo "$STUFF"
		else	
			echo "$i differs"
		fi	
	fi
done
cd $oldcwd 



syntax highlighted by Code2HTML, v. 0.9.1