components/prboom/w_wad.c
//
// 1/18/98 killough: adds a default extension to a path
// Note: Backslashes are treated specially, for MS-DOS.
//
1/18/98 killough: adds a default extension to a path
Note: Backslashes are treated specially, for MS-DOS.
1 / 18 / 98 killough : adds a default extension to a path Note : Backslashes are treated specially for MS - DOS .
char *AddDefaultExtension(char *path, const char *ext)
{
  char *p = path;
  while (*p++);
  while (p-->path && *p!='/' && *p!='\\')
    if (*p=='.')
      return path;
  if (*ext!='.')
    strcat(path,".");
  return strcat(path,ext);
}
char * AddDefaultExtension ( char * path , const char * ext ) { char * p = path ; while ( * p ++ ) ; while ( p -- > path && * p != ' ' && * p != ' \\ ' ) if ( * p == ' ' ) return path ; if ( * ext != ' ' ) strcat ( path , " " ) ; return strcat ( path , ext ) ; }
1/18/98 killough: adds a default extension to a path
Note: Backslashes are treated specially, for MS-DOS.
1 / 18 / 98 killough : adds a default extension to a path Note : Backslashes are treated specially for MS - DOS .