From 4a64590196a02952c2e02b11d97109ede5bd277f Mon Sep 17 00:00:00 2001 From: epoch Date: Fri, 18 Feb 2022 19:25:51 +0000 Subject: added spacify --- spacify.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spacify.c (limited to 'spacify.c') diff --git a/spacify.c b/spacify.c new file mode 100644 index 0000000..a02ba31 --- /dev/null +++ b/spacify.c @@ -0,0 +1,19 @@ +#include +#include + +int main(int argc,char *argv[]) { + int in,i,left,col=0,tabsize=8; + for(left=0;(in=fgetc(stdin)) != -1;left++) { + if(in == '\t') { + col++; + if(argc > col) tabsize=atoi(argv[col]); + if(!tabsize) tabsize=8;//they did something dumb. force it to not do that. + for(i=left%tabsize;i