#!/bin/csh -f
#  
#  $Header:$
#  $Source:$
#  $Author:$
# 
# This script is used to diff kerberos file that are being
# audited. The usage is 
#
# krbdiff filename sourcepath
#
# The result is diff -c sourcepath/filename filename 
#
# If the filename without an extension is Imakefile, the
# extension
# is removed for the first pathname.
#


if ($#argv != 2) then
   echo "Usage: krbdiff filename sourcepath"
   exit 1
endif

set filename = $1
set sourcepath = $2

# Get the filename with no extension and no path
set fnnopath = $filename:t
set fnnoext = $fnnopath:r

set krbsrc = /mit/kerberos/src/

if (${fnnoext} == Imakefile) then
   set oldfile = ${krbsrc}${sourcepath}/${fnnopath:r}
else
   set oldfile = ${krbsrc}${sourcepath}/${fnnopath}
endif 

set newfile = $filename

diff -c $oldfile $newfile
