# 2.11BSD#431 - /usr/src/new/notes/src/check.c

##### Functions

    chkpath           X
    patcheck          X

       1: #include "parms.h"
       2: #include "structs.h"
       3:
       4: #ifdef  RCSIDENT
       5: static char rcsid[] = "$Header: check.c,v 1.7 85/01/18 15:06:01 notes Rel $";
       6: #endif	RCSIDENT
       7:
       8: /*
       9:  *	check.c - checks the arguement supplied. If there are any
      10:  *	.'s or /'s in the name a -1 is returned.
      11:  *	If the string is . and / free, then a zero is returned.
      12:  *
      13:  *	Ray Essick	23-nov-1981
      14:  */
      15:
      16:
      17: chkpath (p)
      18: char   *p;
      19: {
      20:     int     count;
      21:
      22:     if (*p == '.')
      23:     return (-1);                    /* hidden is bad */
      24:     count = 0;
      25:     while (*p && (*p != '/') && (*p != ' ') && (*p != ':'))
      26:     {
      27:     count++;
      28:     p++;
      29:     }
      30:     if (count > NNLEN)
      31:     return (-1);                    /* name too long */
      32:     if (*p == 0)
      33:     return 0;
      34:     else
      35:     return (-1);
      36: }
      37:
      38: /*
      39:  *	patcheck - look for a pattern character. These are the shell
      40:  *	meta-characters ?, [, and *
      41:  *	Return 0 if non exist in the string
      42:  */
      43: patcheck (p)
      44: char   *p;
      45: {
      46:     register char  *q;
      47:     q = p;
      48:     while (*q && (*q != '?') && (*q != '[') && (*q != '*'))
      49:     q++;
      50:     return (*q != '\0');                /* return 0 if no pattern */
      51: }

#### Defined functions

chkpath defined in line 17; used 3 times

- in /usr/src/new/notes/src/buildnf.c line 60
- in /usr/src/new/notes/src/recsio.c line 102
- in /usr/src/new/notes/src/rmnf.c line 61

patcheck defined in line 43; used 2 times

- in /usr/src/new/notes/src/expand.c line 156, 168

#### Defined variables

rcsid defined in line 5; never used

Last modified: 1985-01-19 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 426 |