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