Browse Source

tools/stripfc: strip a little bit more

pull/102/head
Virgil Dupras 4 years ago
parent
commit
d6c9ab3f32
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      tools/stripfc.c

+ 6
- 4
tools/stripfc.c View File

@@ -13,15 +13,17 @@ by more than once space or by a newline. Hackish, but works.

int main()
{
int spccnt = 0;
int spccnt = 2; // if the first char is a (, consider it a comment opener.
int incomment = 0;
int c;
c = getchar();
while ( c != EOF ) {
if (c == '\n') {
// We still spit newlines whenever we see them, Forth interpreter
// doesn't like when they're not there...
putchar(c);
if (!incomment) {
// We still spit newlines whenever we see them, Forth interpreter
// doesn't like when they're not there...
putchar(c);
}
spccnt += 2;
} else if (c == ' ') {
spccnt++;


Loading…
Cancel
Save