[go: up one dir, main page]

File: spool.c

package info (click to toggle)
uucp 1.07-19.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,964 kB
  • ctags: 3,210
  • sloc: ansic: 53,817; sh: 4,491; makefile: 232; perl: 199
file content (30 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (14)
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
/* spool.c
   See whether a filename is legal for the spool directory.  */

#include "uucp.h"

#include <ctype.h>

#include "uudefs.h"

/* See whether a file is a spool file.  Spool file names are specially
   crafted to hand around to other UUCP packages.  They always begin
   with 'C', 'D' or 'X', and the second character is always a period.
   The remaining characters may be any printable characters, since
   they may include a grade set by another system.  */

boolean
fspool_file (zfile)
     const char *zfile;
{
  const char *z;

  if (*zfile != 'C' && *zfile != 'D' && *zfile != 'X')
    return FALSE;
  if (zfile[1] != '.')
    return FALSE;
  for (z = zfile + 2; *z != '\0'; z++)
    if (*z == '/' || ! isprint (BUCHAR (*z)) || isspace (BUCHAR (*z)))
      return FALSE;
  return TRUE;
}