mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:58:09 +11:00
tools/stripfc: strip a little bit more
This commit is contained in:
parent
9548514ff0
commit
d6c9ab3f32
@ -13,15 +13,17 @@ by more than once space or by a newline. Hackish, but works.
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int spccnt = 0;
|
int spccnt = 2; // if the first char is a (, consider it a comment opener.
|
||||||
int incomment = 0;
|
int incomment = 0;
|
||||||
int c;
|
int c;
|
||||||
c = getchar();
|
c = getchar();
|
||||||
while ( c != EOF ) {
|
while ( c != EOF ) {
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
|
if (!incomment) {
|
||||||
// We still spit newlines whenever we see them, Forth interpreter
|
// We still spit newlines whenever we see them, Forth interpreter
|
||||||
// doesn't like when they're not there...
|
// doesn't like when they're not there...
|
||||||
putchar(c);
|
putchar(c);
|
||||||
|
}
|
||||||
spccnt += 2;
|
spccnt += 2;
|
||||||
} else if (c == ' ') {
|
} else if (c == ' ') {
|
||||||
spccnt++;
|
spccnt++;
|
||||||
|
Loading…
Reference in New Issue
Block a user