#!/bin/sh

#
# Designed to work with the "patchgen" script, to create editable copies of
# original source files.  Saves originals in "file.original" (or whatver
# suffix setting is)
#
# This code copyright October 1998 by
# W.M. Richards, NiEstu, Phoenix, AZ -- chipr@niestu.com
#
# This software is made freely available under the provisions of the Perl
# "Artistic" license:  http://language.perl.com/misc/Artistic.html
#
# This code is not supported and is not warranteed to perform any particular
# function. Contact chipr@niestu.com for aditional information.
# If you find bugs or make enhancements, it would be appreciated if you
# sent them on to the author at chipr@niestu.com.
#

#
# Usage: ednew file ...
#


suffix="original"

for file in $* ; do
   if [ -e $file.$suffix ]; then
      echo "File \"$file.$suffix\" exists--no move done"
   else
      mv $file $file.$suffix
      cp $file.$suffix $file
      chmod +w $file
      echo "$file ready to edit"
   fi
done
