/* getext.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */

#include <sys/emx.h>
#include <stdlib.h>
#include <string.h>

char *_getext (const char *path)
{
  int sep;
  const char *dotp;

  sep = TRUE; dotp = NULL;
  while (*path != 0)
    {
      switch (*path)
        {
        case '.':
          dotp = (sep ? NULL : path);
          sep = FALSE;
          break;
        case ':':
        case '/':
        case '\\':
          dotp = NULL;
          sep = TRUE;
          break;
        default:
          sep = FALSE;
          break;
        }
      ++path;
    }
  return ((char *)dotp);
}
