unsplit.c

AlloyMUSH-1.1/src/unsplit.c · 602 B

From the archive AlloyMUSH-1.1.tar.gz

Download the archive   « Back to the archive contents

/* unsplit.c -- filter for re-combining continuation lines */

#ifndef	lint
static char RCSid[] = "$Id: unsplit.c,v 1.3 1994/10/24 15:01:55 xmen Exp $";

#endif

#include "copyright.h"

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

void 
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