#!/bin/sh
#
# This file should only be run automatically by make, not directly by
# the user.
#
# This script is part of the SUIF version control system.  It takes
# one argument, a version label.  In prints to standard output the
# next version label that should follow the given label.

if (test ${1}"" = "") ; then
    echo "no version specified" 1>&2
    exit 1
fi

echo ${1} | gawk 'BEGIN {FS = "."};
                  {for (i = 1; i < NF; ++i)
                       printf "%s", $i".";
                   if ($NF + 0 == $NF)
                       print $NF + 1;
                   else
                       print $NF".1"}'

exit 0
