Next Hold Space 4

The Dawn of Time

        /* Take a man page and strip out the _^H's. */
        #include <stdio.h>
        #define CTLH 8 /* Code for a control-H */
        main()
        {
        char c;
        int ulflag = 0; /* set this if I just read an underline character */
        while ((c= getchar()) != EOF)
          {
          if (ulflag == 1)
            {
            ulflag = 0;
            if (c != CTLH)
              printf("_%c",c);
            }
          else 
            {
            if (c == '_')
              ulflag = 1;
            else
              printf("%c",c);
            }
          }
        }

Next Copyright © 2011 M. J. Dominus