taptospc

/* C-Program to change tabs to spaces in input files. */
/* Works as a filter: I/O should be re-directed using <> etc. */
/* (c) B.Meissner, Universitaet der Bundeswehr, 2005 */
/* gcc -o tabtosp -O6 -finline-functions */
/* -fstrength-reduce -fomit-frame-pointer tabtosp.c */

#include <stdio.h>

main()

{

int c ; /* our „buffer“ */

while ((c = getc(stdin)) != EOF ) /* read one byte a time */
/* from standardin */
{

if (c == 9 ) /* TAB = ASCII 9 */
c = 32 ; /* SP = ASCII 32 */

putc(c,stdout) ; /* write standardout */

}

}

HSU

Letzte Änderung: 20. März 2018