bwbasic bug with \ operator
Hello,
Since I was unable to uncompress the sourceforge bwbasic code,
I turned to debian to get bwbasic source. I got the
bwbasic_2.2pl2.orig.tar.gz and applied the bwbasic_2.20pl2-6.diff.gz
but learned the \ operator does not work. I have created a patch
which sovles this problem (attached) and it includes a tiny program
to demo the problem. When compiled without my patch it will say
failed, but when compiled with my patch it will say passed.
It is not fixed in the newer unstable patch for bwbasic_2.20pl2-8.diff.gz
either.
The patch to bwb_ops.c is just 2 lines, and the rest is just
to show why you need it and can be dropped without problems.
I send this to you since the sourceforge maintainer has not fixed
the corrupted archive for over 2 years and thus the software has
only you as the maintainer now.
Thank you,
JGH
diff -Naur bwbasic-2.20pl2.orig/bwb_ops.c bwbasic-2.20pl2.orig.fixed/bwb_ops.c
--- bwbasic-2.20pl2.orig/bwb_ops.c 1995-11-26 05:32:18.000000000 +0700
+++ bwbasic-2.20pl2.orig.fixed/bwb_ops.c 2005-11-20 21:30:28.000000000 +0700
@@ -1515,8 +1515,8 @@
}
CURTASK exps[ level - 1 ].nval
- = exp_getnval( &( CURTASK exps[ level - 1 ] ))
- / exp_getnval( &( CURTASK exps[ level + 1 ] ));
+ = (int)(exp_getnval( &( CURTASK exps[ level - 1 ] ))
+ / exp_getnval( &( CURTASK exps[ level + 1 ] )));
break;
}
diff -Naur bwbasic-2.20pl2.orig/bwbtest/index.txt bwbasic-2.20pl2.orig.fixed/bwbtest/index.txt
--- bwbasic-2.20pl2.orig/bwbtest/index.txt 1993-08-29 04:37:46.000000000 +0700
+++ bwbasic-2.20pl2.orig.fixed/bwbtest/index.txt 2005-11-20 21:35:55.000000000 +0700
@@ -21,6 +21,7 @@
___ ___ GOTOLABL BAS * STRUCT_CMDS
___ ___ IFLINE BAS
___ ___ INPUT BAS
+___ ___ INTDIV BAS
___ ___ LOF BAS * LOF(): IMPLEMENTATION-SPECIFIC
___ ___ LOOPUNTL BAS * STRUCT_CMDS
___ ___ MAIN BAS * STRUCT_CMDS
diff -Naur bwbasic-2.20pl2.orig/bwbtest/intdiv.bas bwbasic-2.20pl2.orig.fixed/bwbtest/intdiv.bas
--- bwbasic-2.20pl2.orig/bwbtest/intdiv.bas 1970-01-01 07:00:00.000000000 +0700
+++ bwbasic-2.20pl2.orig.fixed/bwbtest/intdiv.bas 2005-11-20 21:35:23.000000000 +0700
@@ -0,0 +1,8 @@
+10 rem INTDIV.BAS -- test \ operator
+20 I = 3
+30 J = I \ 2
+40 if J=1 then 70
+50 print "failed"
+60 goto 80
+70 print "passed"
+80 end
Reply to: