summaryrefslogtreecommitdiffstats
path: root/gnu/libexec/uucp/libunix/uuto.c
blob: debba9d6fd0108f9f969e1f089e949a8ed4148b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* uuto.c
   Translate a destination for uuto.  */

#include "uucp.h"

#include "uudefs.h"
#include "sysdep.h"
#include "system.h"

/* Translate a uuto destination for Unix.  */

char *
zsysdep_uuto (zdest, zlocalname)
     const char *zdest;
     const char *zlocalname;
{
  const char *zexclam;
  char *zto;

  zexclam = strrchr (zdest, '!');
  if (zexclam == NULL)
    return NULL;
  zto = (char *) zbufalc (zexclam - zdest
			  + sizeof "!~/receive///"
			  + strlen (zexclam)
			  + strlen (zlocalname));
  memcpy (zto, zdest, (size_t) (zexclam - zdest));
  sprintf (zto + (zexclam - zdest), "!~/receive/%s/%s/",
	   zexclam + 1, zlocalname);
  return zto;
}
OpenPOWER on IntegriCloud