[BACK]Return to rfc-pg.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/rfc-pg.c, Revision 1.1

1.1     ! deraadt     1: /*
        !             2:
        !             3: rfc-pg.c
        !             4:
        !             5: Author: Tatu Ylonen <ylo@cs.hut.fi>
        !             6:
        !             7: Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
        !             8:                    All rights reserved
        !             9:
        !            10: Created: Fri Jul  7 02:14:16 1995 ylo
        !            11:
        !            12: */
        !            13:
        !            14: /* RCSID("$Id: rfc-pg.c,v 1.2 1999/05/04 11:59:04 bg Exp $"); */
        !            15:
        !            16: #include <stdio.h>
        !            17:
        !            18: int main()
        !            19: {
        !            20:   int add_formfeed = 0;
        !            21:   int skipping = 0;
        !            22:   int ch;
        !            23:
        !            24:   while ((ch = getc(stdin)) != EOF)
        !            25:     {
        !            26:       if (ch == '\n')
        !            27:        {
        !            28:          if (add_formfeed)
        !            29:            {
        !            30:              putc('\n', stdout);
        !            31:              putc('\014', stdout);
        !            32:              putc('\n', stdout);
        !            33:              add_formfeed = 0;
        !            34:              skipping = 1;
        !            35:              continue;
        !            36:            }
        !            37:          if (skipping)
        !            38:            continue;
        !            39:        }
        !            40:       skipping = 0;
        !            41:       if (ch == '\014')
        !            42:        {
        !            43:          add_formfeed = 1;
        !            44:          continue;
        !            45:        }
        !            46:       putc(ch, stdout);
        !            47:     }
        !            48:   exit(0);
        !            49: }