summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2022-11-13 12:18:38 +0200
committerIgor Pashev <pashev.igor@gmail.com>2022-11-13 12:59:19 +0200
commit835006eb03caeae86ef84d094f5b878cf16aad47 (patch)
tree544a0d07bb4eae1e08bc5e71eef6b61eae892dc6
parent82941c076d5f8d026544158cae438dc2764cb2de (diff)
downloadgcd-835006eb03caeae86ef84d094f5b878cf16aad47.tar.gz
Update Forth
No crash on empty list.
-rw-r--r--gcd.fs3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcd.fs b/gcd.fs
index 1baeda0..c66f291 100644
--- a/gcd.fs
+++ b/gcd.fs
@@ -30,7 +30,8 @@
r> 1 + >r
repeat
2drop
- r> gcdn . cr
+ r>
+ dup 0 <> if gcdn . cr else drop endif
;
main bye