-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: segfault
action: blob
revision:
path_from: spacify.c
revision_from: refs/heads/master:
path_to:
revision_to:

git.thebackupbox.net

segfault

git://git.thebackupbox.net/segfault

blob of:

segfault

/ spacify.c

refs/heads/master:/spacify.c
 #include <stdio.h>
 #include <stdlib.h>

 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<tabsize;i++) putchar(' ');
       left=-1;
       continue;
     }
     if(in == '\n') { left=-1; col=0; }
     putchar(in);
   }
   return 0;
 }

-- Response ended

-- Page fetched on Sun Jun 2 18:36:02 2024