/*----------------------------------------------------------------------
      Paste together two pieces of a file name path

  Args: pathbuf      -- Put the result here
        first_part   -- of path name
        second_part  -- of path name
 
 Result: New path is in pathbuf.  No check is made for overflow.

BUGS:  This is a first stab at dealing with fs naming dependencies, and others 
still exist.
  ----*/
void
build_path(pathbuf, first_part, second_part)
    char *pathbuf, *first_part, *second_part;
{
    register int i;

    for(i = 0; first_part[i]; i++)
      *pathbuf++ = first_part[i];

    if(i && first_part[i-1] == '\\'){		/* first part ended with \  */
        if(*second_part == '\\')		/* and second starts with \ */
	  second_part++;			/* else just append second  */
    }
    else if(*second_part != '\\')		/* no slash at all, so      */
      *pathbuf++ = '\\';			/* insert one...	    */

    while(*second_part)
      *pathbuf++ = *second_part++;

    *pathbuf = '\0';
}


