/***************************************************************************
 *                                                                         *
 *   SAMEND.C                                                              *
 *                                                                         *
 *   Copyright (c) 1993-1997 Galacticomm, Inc.    All Rights Reserved.     *
 *                                                                         *
 *   This is the GCOMM.LIB routine for determining if a string ends with   *
 *   another string.  1=yes, 0=no.                                         *
 *                                                                         *
 *                                            - R. Stein 1/16/93           *
 *                                                                         *
 ***************************************************************************/

#include "gcomm.h"

#define FILREV "$Revision: 5 $"

GBOOL                              /*   returns TRUE=stg ends with pattern */
samend(                            /* comp end of long stg with a short stg*/
const CHAR *longs,                 /*   long string to compare             */
const CHAR *ends)                  /*   end pattern to search for          */
{
     INT ne,nl;

     return(((ne=strlen(ends)) <=
             (nl=strlen(longs)) && sameas(ends,longs+nl-ne)) ? TRUE : FALSE);
}
