freebsd-dev/gnu/libexec/uucp/libunix/sindir.c
1994-05-07 18:14:43 +00:00

30 lines
548 B
C

/* sindir.c
Stick a directory and file name together. */
#include "uucp.h"
#include "uudefs.h"
#include "sysdep.h"
#include "system.h"
char *
zsysdep_in_dir (zdir, zfile)
const char *zdir;
const char *zfile;
{
size_t cdir, cfile;
char *zret;
cdir = strlen (zdir);
cfile = strlen (zfile);
zret = zbufalc (cdir + cfile + 2);
if (cdir == 1 && *zdir == '/')
cdir = 0;
else
memcpy (zret, zdir, cdir);
memcpy (zret + cdir + 1, zfile, cfile);
zret[cdir] = '/';
zret[cdir + cfile + 1] = '\0';
return zret;
}