freebsd-dev/gnu/libexec/uucp/libunix/sindir.c

30 lines
548 B
C
Raw Normal View History

1993-08-05 18:28:27 +00:00
/* 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);
1994-05-07 18:14:43 +00:00
if (cdir == 1 && *zdir == '/')
cdir = 0;
else
memcpy (zret, zdir, cdir);
1993-08-05 18:28:27 +00:00
memcpy (zret + cdir + 1, zfile, cfile);
zret[cdir] = '/';
zret[cdir + cfile + 1] = '\0';
return zret;
}