summaryrefslogtreecommitdiff
path: root/gnu/libexec/uucp/libunix/corrup.c
blob: 87f19e668894824f29ca0d28cd0a13e1f05a5d24 (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
32
33
/* corrup.c
   Save a file in the .Corrupt directory.  */

#include "uucp.h"

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

char *
zsysdep_save_corrupt_file (zfile)
     const char *zfile;
{
  const char *zslash;
  char *zto;

  zslash = strrchr (zfile, '/');
  if (zslash == NULL)
    zslash = zfile;
  else
    ++zslash;

  zto = zsappend3 (zSspooldir, CORRUPTDIR, zslash);

  if (! fsysdep_move_file (zfile, zto, TRUE, FALSE, FALSE,
			   (const char *) NULL))
    {
      ubuffree (zto);
      return NULL;
    }

  return zto;
}