Skip to content

Commit d862b12

Browse files
authored
Merge pull request #258 from venomix666/lbforth
Change CR word to emit both CR and LF
2 parents da28dc5 + e95137e commit d862b12

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

third_party/lbforth/lbforth.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const char *initScript =
120120
": / /MOD NIP ;\n"
121121
": MOD /MOD DROP ;\n"
122122
": BL 32 ;\n"
123-
": CR 10 EMIT ;\n"
123+
": CR 13 EMIT 10 EMIT ;\n"
124124
": SPACE BL EMIT ;\n"
125125
": NEGATE 0 SWAP - ;\n"
126126
": DNEGATE 0. 2SWAP D- ;\n"
@@ -677,6 +677,7 @@ BUILTIN(38, "QUIT", quit, 0)
677677
tell("Unknown word: ");
678678
for (i=0; i<memory[0]; i++)
679679
putkey(memory[i+1]);
680+
putkey('\r');
680681
putkey('\n');
681682

682683
*sp = *rsp = 1;
@@ -886,7 +887,7 @@ BUILTIN(58, "*/", timesDivide, 0)
886887
push((cell)r);
887888
if ((cell)r != r)
888889
{
889-
tell("Arithmetic overflow\n");
890+
tell("Arithmetic overflow\r\n");
890891
errorFlag = 1;
891892
}
892893
}
@@ -902,7 +903,7 @@ BUILTIN(59, "*/MOD", timesDivideMod, 0)
902903
push((cell)r);
903904
if ((cell)r != r)
904905
{
905-
tell("Arithmetic overflow\n");
906+
tell("Arithmetic overflow\r\n");
906907
errorFlag = 1;
907908
}
908909
}

0 commit comments

Comments
 (0)