unsplit.c

tinymush-3.1p1/src/unsplit.c · 557 B

From the archive tm31p1.tar.gz

Download the archive   « Back to the archive contents

/* unsplit.c - filter for re-combining continuation lines */
/* $Id: unsplit.c,v 1.6 2001/01/18 08:07:04 dpassmor Exp $ */

#include "copyright.h"
#include "autoconf.h"

#include <stdio.h>
#include <ctype.h>

int main(argc, argv)
int argc;
char **argv;
{
	int c, numcr;

	while ((c = getchar()) != EOF) {
		if (c == '\\') {
			numcr = 0;
			do {
				c = getchar();
				if (c == '\n')
					numcr++;
			} while ((c != EOF) && isspace(c));
			if (numcr > 1)
				putchar('\n');
			ungetc(c, stdin);
		} else {
			putchar(c);
		}
	}
	fflush(stdout);
	exit(0);
}

Site Stats

Snippets: 1791
Codebases: 571