File:  [CSRG BSD Unix] / 3BSD / cmd / uucp / versys.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:53 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, CSRG
CVS tags: HEAD, BSD3
BSD 3.0

#include "uucp.h"


#define SNAMESIZE 7

/*******
 *	versys(name)	verify system names n1 and n2
 *	char *name;
 *
 *	return codes:  0  |  FAIL
 */

versys(name)
char *name;
{
	FILE *fp;
	char **fnp;
	char line[300];
	char s1[SNAMESIZE + 1];
	char myname[SNAMESIZE + 1];
	char *index();

	sprintf(myname, "%.7s", Myname);
	sprintf(s1, "%.7s", name);
	if (strcmp(s1, myname) == 0)
		return(0);
	for (fnp = Sysfiles; *fnp != NULL; fnp++) {
		fp = fopen(*fnp, "r");
		if (fp == NULL)
			continue;
	
		while (fgets(line, 300, fp) != NULL) {
			*(index(line, ' ')) = '\0';
			line[7] = '\0';
			if (strcmp(s1, line) == SAME) {
				fclose(fp);
				return(0);
			}

		}
		fclose(fp);
	}
	return(FAIL);
}

unix.superglobalmegacorp.com

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