home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / unix.subproj / corrup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  549 b   |  34 lines

  1. /* corrup.c
  2.    Save a file in the .Corrupt directory.  */
  3.  
  4. #include "uucp.h"
  5.  
  6. #include "sysdep.h"
  7. #include "uudefs.h"
  8. #include "system.h"
  9.  
  10. char *
  11. zsysdep_save_corrupt_file (zfile)
  12.      const char *zfile;
  13. {
  14.   const char *zslash;
  15.   char *zto;
  16.  
  17.   zslash = strrchr (zfile, '/');
  18.   if (zslash == NULL)
  19.     zslash = zfile;
  20.   else
  21.     ++zslash;
  22.  
  23.   zto = zsappend3 (zSspooldir, CORRUPTDIR, zslash);
  24.  
  25.   if (! fsysdep_move_file (zfile, zto, TRUE, FALSE, FALSE,
  26.                (const char *) NULL))
  27.     {
  28.       ubuffree (zto);
  29.       return NULL;
  30.     }
  31.  
  32.   return zto;
  33. }
  34.