Annotation of 3BSD/cmd/uucp/versys.c, revision 1.1.1.1

1.1       root        1: #include "uucp.h"
                      2: 
                      3: 
                      4: #define SNAMESIZE 7
                      5: 
                      6: /*******
                      7:  *     versys(name)    verify system names n1 and n2
                      8:  *     char *name;
                      9:  *
                     10:  *     return codes:  0  |  FAIL
                     11:  */
                     12: 
                     13: versys(name)
                     14: char *name;
                     15: {
                     16:        FILE *fp;
                     17:        char **fnp;
                     18:        char line[300];
                     19:        char s1[SNAMESIZE + 1];
                     20:        char myname[SNAMESIZE + 1];
                     21:        char *index();
                     22: 
                     23:        sprintf(myname, "%.7s", Myname);
                     24:        sprintf(s1, "%.7s", name);
                     25:        if (strcmp(s1, myname) == 0)
                     26:                return(0);
                     27:        for (fnp = Sysfiles; *fnp != NULL; fnp++) {
                     28:                fp = fopen(*fnp, "r");
                     29:                if (fp == NULL)
                     30:                        continue;
                     31:        
                     32:                while (fgets(line, 300, fp) != NULL) {
                     33:                        *(index(line, ' ')) = '\0';
                     34:                        line[7] = '\0';
                     35:                        if (strcmp(s1, line) == SAME) {
                     36:                                fclose(fp);
                     37:                                return(0);
                     38:                        }
                     39: 
                     40:                }
                     41:                fclose(fp);
                     42:        }
                     43:        return(FAIL);
                     44: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.