home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gccdist / gcc-src / vms / gcclib / rindex.c < prev    next >
Encoding:
Text File  |  1991-02-27  |  503 b   |  31 lines

  1. /*
  2.  *
  3.  *    This function was not included in the VAX-11 "C" runtime system.
  4.  *
  5.  */
  6. char *rindex(cp, character)
  7. register char *cp;
  8. register char character;
  9. {
  10.     register char *cp1;
  11.  
  12.     /*
  13.      *    Assume "not found"
  14.      */
  15.     cp1 = 0;
  16.     /*
  17.      *    Search for the index character
  18.      */
  19.     do {
  20.         /*
  21.          *    If this is the index character remember it as the
  22.          *    one most towards the end of the string.
  23.          */
  24.         if (*cp == character) cp1 = cp;
  25.     } while (*cp++);
  26.     /*
  27.      *    Return the pointer to the index character
  28.      */
  29.     return(cp1);
  30. }
  31.