File:  [Research Unix] / researchv8dc / cmd / wwb / dictadd.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv8, HEAD
researchv8 Dan Cross

/* NOTICE-NOT TO BE DISCLOSED OUTSIDE BELL SYS EXCEPT UNDER WRITTEN AGRMT */
/* Writer's Workbench version 2.1, March 8, 1981 */
#include <stdio.h>
main(argc,argv)
char *argv[];
int argc;
{
	FILE *fp, *fopen();
	int len;
	char phrase[100];
	char *ptr = phrase;
	if((fp=fopen(argv[1],"a"))==NULL){
		fprintf(stderr,"Dictadd can't write on %s\n",argv[1]);
		exit(1);
	}
	putchar('>');
	while(gets(phrase) != EOF){
		len = strlen(phrase);
		if((*ptr == 'q' || *ptr == '.') && len == 1)break;
		if(*ptr=='\0' ) {
			fprintf(stderr,"error: pattern not stored\n");
			continue;
		}
		if(*ptr!='~'&& *ptr!=' ')putc(' ',fp);
		fprintf(fp,"%s",phrase);
		if(*ptr!='~'&& phrase[len-1]!=' ') putc(' ',fp);
		putc('\n',fp);
		putchar('>');
	}
}

unix.superglobalmegacorp.com

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