mux/src/unsplit.cpp

Go to the documentation of this file.
00001 // unsplit.cpp -- Filter for re-combining continuation lines.
00002 //
00003 // $Id: unsplit.cpp,v 1.1 2003/01/22 19:58:26 sdennis Exp $
00004 //
00005 
00006 #include "copyright.h"
00007 
00008 #include <stdio.h>
00009 #include <ctype.h>
00010 
00011 int main(int argc, char *argv[])
00012 {
00013     int c, numcr;
00014 
00015     while ((c = getchar()) != EOF)
00016     {
00017         if (c == '\\')
00018          {
00019             numcr = 0;
00020             do
00021             {
00022                 c = getchar();
00023                 if (c == '\n')
00024                     numcr++;
00025             } while ((c != EOF) && isspace(c));
00026             if (numcr > 1)
00027             {
00028                 putchar('\n');
00029             }
00030             ungetc(c, stdin);
00031         }
00032         else
00033         {
00034             putchar(c);
00035         }
00036     }
00037     return 0;
00038 }

Generated on Mon May 28 04:40:12 2007 for MUX by  doxygen 1.4.7