1 This file explains, usually via sample code, some bugs that exist in
2 this release of Regina. The smaller this file the better!
3 Outstanding bugs are first; fixed ones at the end of this file.
5 /*--------------------------------------------------------------------
6 * INTERPRET "return" does not work correctly. If a value is returned
7 * it does work correctly.
8 * Reported by: Paul G. Barnett
14 Say "should not get here!"
17 /*--------------------------------------------------------------------
18 * LINES() BIF on transient streams return 1 when really at EOF
19 * Run program below as:
20 * regina test.rex BUGS
22 * cat BUGS | regina test.rex
23 * Reported by: Mark Hessling
31 Do While(Lines(fn) > 0)
33 numlines = numlines + 1
35 Say numlines 'in file'
37 /*--------------------------------------------------------------------
38 * Regina appears to read complete data files into memory in some
39 * operations. More details to be specified.
46 /*--------------------------------------------------------------------
47 * Clauses in the Interpret command are not traced correctly.
48 * Reported by: Dennis Bareis
54 /*--------------------------------------------------------------------
55 * TRACE R and TRACE I produce incorrect results in various
57 * Reported by: Various
63 /*--------------------------------------------------------------------
64 * Regina is inconsistent with the ANSI standard when it comes to
65 * treatment of whitespace in various circumstances.
66 * Reported by: Dennis Baeris
67 * Bug Number: 20000505-73993
75 if a = b then say 'incorrect'
76 else say 'ANSI correct'
78 if strip(a) == strip(b) then say 'ANSI correct'
81 /*--------------------------------------------------------------------
82 * Regina does not trap conditions in externally called routines
83 * Reported by: Mark Hessling
97 /* a2.rex - must be in REGINA_MACROS */
108 ======================================================================
109 ============================= FIXED ==================================
110 ======================================================================
112 /*--------------------------------------------------------------------
113 * Subroutines cannot have leading numerics in their name.
114 * Reported by: Frank M. Ramaekers Jr.
116 * Fixed by: Mark Hessling
120 rc = 1000_my_proc( "value" )
123 1000_my_proc: Procedure
128 /*--------------------------------------------------------------------
129 * Calling CHAROUT with the newline character, '0a'x, would result in
130 * a CR and LF being output. This only happens under DOS, OS/2 and
132 * Reported by: Dennis Bareis
134 * Fixed by: Mark Hessling
138 Call charout "myfile", "Line 1" || newl
141 /*--------------------------------------------------------------------
142 * Line continuation character; ',' followed by CRLF in source file
143 * would give syntax error.
144 * Reported by: Florian Grosse-Coosmann
146 * Fixed by: Mark Hessling
149 Say 'Hello', /* line ends in CRLF pair */
153 /*--------------------------------------------------------------------
154 * The value of the last token parsed with PARSE contains incorrect
156 * Reported by: Dennis Bareis
158 * Fixed by: Florian Grosse-Coosmann
162 Parse Var a one two three
163 Say '<' || three || '>'
165 /*--------------------------------------------------------------------
166 * The value returned by CHARS BIF was incorrect especially after a
167 * LINEIN call. The result is the example following would never end.
168 * Reported by: Yuri Shemanin
170 * Fixed by: Yuri Shemanin
174 Do While Chars(f) <> 0
178 /*--------------------------------------------------------------------
179 * On some platforms, if operating system command redirection was
180 * done using >FIFO, and the current directory was not writeable by
181 * the user, the command would fail. The cause is that the tmpnam()
182 * C library function is broken on several compilers.
183 * Added workaround to use environment variables, TMP, TEMP or TMPDIR.
186 * Fixed by: Mark Hessling
190 /*--------------------------------------------------------------------
191 * On platforms that did not have a C library function, alloca()
192 * Regina would leak memory. This has now been fixed by inclusion
193 * of our own alloca() function if one doesn't exist.
194 * Reported by: Mark Hessling
196 * Fixed by: Mark Hessling
200 /*--------------------------------------------------------------------
201 * A bug in the Win95/98 command processor results in any call to
202 * an operating system command ALWAYS return 0, even though the
204 * This change attempts to circumvent this bug, but it can't in all
205 * circumstances. If the operating system command called is an
206 * executable file, and there is no output/input redirection, then
207 * the return code from the executable program will be returned. Any
208 * internal COMMAND.COM command, such as COPY, will ALWAYS return 0;
209 * there is no way around this until M$ fix there COMMAND.COM.
210 * If you use JP Software's 4DOS for NT, then you will have no problems
211 * as it correctly returns the error from the internal command.
212 * Reported by: Michael Sundermann
214 * Fixed by: Michael Sundermann
218 /*--------------------------------------------------------------------
219 * The result of the expression (0 = zero) should be 1, but Regina
221 * Reported by: Dan Hofferth
223 * Fixed by: Florian Grosse-Coosman
227 say ( 0 = zero ) /* should say 1, but 0 */
229 /*--------------------------------------------------------------------
230 * A numeric variable "exposed" by a procedure and subsequently used
231 * in a loop within the procedure that exposed it, gets an erroneous
233 * Reported by: rick@emma.panam.wimsey.com
235 * Fixed by: Florian Grosse-Coosmann
240 Say 'num = ' num ';should be 6'
243 my_proc: Procedure Expose num
244 Say 'num = ' num ';should be 0'
248 Say 'num = ' num ';should be 3'
250 Say 'num = ' num ';should be 6'
253 /*--------------------------------------------------------------------
254 * An error with dropping variables...
255 * Reported by: Dennis Bareis
257 * Fixed by: Mark Hessling
260 call SaveInfo "Fred", "FredsValue";
261 call SaveInfo "Fred", "FredsValue2";
262 call HandleUndefCommand "Fred";
263 call SaveInfo "Fred", "FredsValue3";
268 SavedAs = "Define." || arg(1);
270 say '0.DROPPING "' || SavedAs || '"';
271 if symbol(SavedAs) = 'VAR' then
275 /*--- Check if variable previously existed ------------------------*/
277 say '0.SETTING - ' || arg(1) || ' to "' || arg(2) || '"';
278 SavedAs = "Define." || arg(1);
279 if symbol(SavedAs) = 'VAR' then
280 say '1.Already Existed';
284 /*--- Save info ---------------------------------------------------*/
285 ExecutingCmd = SavedAs || ' = arg(2)'
286 say '2.Executing: "' || ExecutingCmd || '"'
287 interpret ExecutingCmd;
289 /*--- Check variable again! ---------------------------------------*/
290 if symbol(SavedAs) = 'VAR' then
292 interpret 'ItsValue = ' || SavedAs;
293 say '3.Variable exists, value = "' || ItsValue || '"'
297 say '3.JUST SET VAR YET - Variable does not exist - WRONG!';
303 OUTPUT (note Define.FRED seems to exist TWICE in multiple cases):
305 0.SETTING - Fred to "FredsValue"
307 2.Executing: "Define.Fred = arg(2)"
308 3.Variable exists, value = "FredsValue"
310 0.SETTING - Fred to "FredsValue2"
312 2.Executing: "Define.Fred = arg(2)"
313 3.Variable exists, value = "FredsValue2"
315 0.DROPPING "Define.Fred"
317 0.SETTING - Fred to "FredsValue3"
319 2.Executing: "Define.Fred = arg(2)"
320 3.JUST SET VAR YET - Variable does not exist - WRONG!
323 Dumping variables to <stdout>
324 Variables from bin no 0
325 >>> Variable: EXECUTINGCMD Value: [Define.Fred = arg(2)]
326 Variables from bin no 107
327 >>> Stem : Define. Default: [<none>] Values:
329 >>> Tail: FRED Value: []
330 >>> Stem : DEFINE. Default: [<none>] Values:
332 >>> Tail: FRED Value: [FredsValue3]
333 Variables from bin no 109
334 >>> Variable: ITSVALUE Value: [FredsValue2]
335 Variables from bin no 175
336 >>> Variable: SIGL Value: [8]
337 Variables from bin no 231
338 >>> Variable: SAVEDAS Value: [Define.Fred]
342 /*--------------------------------------------------------------------
343 * Allow "stderr" to be used to refer to stderr in STREAM BIF.
344 * Reported by: Dennis Bareis
346 * Fixed by: Mark Hessling
349 rc = Stream('stderr', 'C', 'QUERY EXISTS')
351 /*--------------------------------------------------------------------
352 * The internal variable SIGL gets updated prematurely.
353 * Reported by: Dennis Bareis
355 * Fixed by: Florian Grosse-Coosmann
363 Call AnotherLabel SIGL
371 /*--------------------------------------------------------------------
372 * A syntax error in a Rexx script passed to the RexxStart() API via
373 * the "instore" option, will exit the program, rather than return an
375 * Reported by: Mark Hessling
377 * Fixed by: Florian Grosse-Coosmann
381 /*--------------------------------------------------------------------
382 * The VALUE() BIF would not set values of compound variables correctly
383 * if the variable is specified in lower case.
384 * Reported by: Jeff Parlant and Dennis Bareis
386 * Fixed by: Mark Hessling
398 func: procedure expose stemname (stemname)
400 do i = 1 to value(stemname||0)
401 r = value(stemname||i,'something else')
405 /*--------------------------------------------------------------------
406 * The value of the last argument to a procedure when using the ARG() BIF
407 * has an incorrect trailing space.
408 * Reported by: Mark Hessling
410 * Fixed by: Mark Hessling
414 Call proc '123', '456'
418 Say '<' || arg(1) || '>' /* displays <123> */
419 Say '<' || arg(2) || '>' /* displays <456 > */
422 /*--------------------------------------------------------------------
423 * INTERPRET "return Func()" does not work correctly.
424 * Reported by: Paul G. Barnett
426 * Fixed by: Mark Hessling
427 * Fixed in: 0.08g - See Bug 020
429 Interpret "Return F1()"
430 Say "should not get here!"
436 /*--------------------------------------------------------------------
437 * File names in Regina are always case sensitive, even on non-Unix
438 * platforms. This can result in incorrect read/write pointers when
439 * referencing a file by name with different case.
440 * Reported by: Jackie Cooper
442 * Fixed by: Mark Hessling
447 Call Lineout, myfile, 'Line1'
448 Call Lineout, myupperfile, 'Line2'
451 Do While(Lines(myfile)>0)
452 numlines = numlines + 1
454 Say 'Should be 2 lines, but got only' numlines
457 /*--------------------------------------------------------------------
458 * Setting Rexx variables using VALUE BIF produce inconsistent results.
459 * Reported by: Dennis Baeris
461 * Fixed by: Mark Hessling
464 call value "Upd.3", "text";
465 say 'a) Upd.3="' || Upd.3 || '"';
466 say 'b) Upd.3="' || value("Upd.3") || '"';
467 say 'c) Upd.3="' || value("UPD.3") || '"';
469 Before fix, output was:
479 /*--------------------------------------------------------------------
480 * Need to fix API call RexxVariablePool() to handle RXSHV_FETCH, RXSHV_SET
481 * and RXSHV_DROPV correctly. They currently behave the same way as
482 * RXSHV_SYFET, RXSHV_SYSET and RXSHV_SYDRO respectively. ie the variables
483 * are treated symbolically rather than explicitly.
484 * Reported by: Mark Hessling
486 * Fixed By: Jim Hasslacher, Jr.
490 /*--------------------------------------------------------------------
491 * Assignment on compound variables does not work.
492 * Reported by: Mike Ruskai
494 * Fixed by: No fix required.
495 * Fixed in: Checked in 0.08h
496 * Comments: Regina follows the ANSI standard when assigning one
497 * stem variable to another.
498 * Confusion arises between the way that Object Rexx
499 * assigns one stem variable to another; Object Rexx does
500 * NOT follow the ANSI standard. In Object Rexx, a.=b.
501 * creates a reference from a. to b.; ie a. is the same
507 say 'FOOBAR.1 set to "One", FOOBAR.2 set to "Two", FOOBAR.5 dropped'
508 say 'assigning newstem1. to foobar. ...'
510 say 'dropping newstem1.4'
512 Say 'NEWSTEM1.1 Value:' '"'newstem1.1'" should be "FOOBAR."'
513 Say 'NEWSTEM1.2 Value:' '"'newstem1.2'" should be "FOOBAR."'
514 Say 'NEWSTEM1.3 Value:' '"'newstem1.3'" should be "FOOBAR."'
515 Say 'NEWSTEM1.4 Value:' '"'newstem1.4'" should be "NEWSTEM1.4"' '<-dropped'
516 Say 'NEWSTEM1.5 Value:' '"'newstem1.5'" should be "FOOBAR."'
517 say 'assigning newstem2. to newstem1. ...'
518 newstem2. = newstem1.
519 say 'dropping newstem2.4'
521 Say 'NEWSTEM2.1 Value:' '"'newstem2.1'" should be "FOOBAR."'
522 Say 'NEWSTEM2.2 Value:' '"'newstem2.2'" should be "FOOBAR."'
523 Say 'NEWSTEM2.3 Value:' '"'newstem2.3'" should be "FOOBAR."'
524 Say 'NEWSTEM2.4 Value:' '"'newstem2.4'" should be "NEWSTEM2.4"' '<-dropped'
525 Say 'NEWSTEM2.5 Value:' '"'newstem2.5'" should be "FOOBAR."'
526 /* with default value for source stem */
531 say 'FOOBAR1. set to "default", FOOBAR1.1 set to "One", FOOBAR1.2 set to "Two", FOOBAR1.5 dropped'
532 say 'assigning newstem. to foobar. ...'
534 say 'dropping newstem.4'
536 Say 'NEWSTEM.1 Value:' '"'newstem.1'" should be "default"'
537 Say 'NEWSTEM.2 Value:' '"'newstem.2'" should be "default"'
538 Say 'NEWSTEM.3 Value:' '"'newstem.3'" should be "default"'
539 Say 'NEWSTEM.4 Value:' '"'newstem.4'" should be "NEWSTEM.4"' '<-dropped'
540 Say 'NEWSTEM.5 Value:' '"'newstem.5'" should be "default"'
541 Say 'NEWSTEM.6 Value:' '"'newstem.6'" should be "default"'
543 /*--------------------------------------------------------------------
544 * Inconsistent, invalid return values from STREAM (QUERY EXISTS) when
545 * using the EMX port of Regina under OS/2. This bug possible on other
547 * Reported by: Dennis Baeris
549 * Fixed by: Mark Hessling
553 Call Stream fn, 'C', 'OPEN WRITE REPLACE'
554 Call Lineout fn,'One line'
555 Call Stream fn, 'C', 'CLOSE'
557 Say 'Linein(fn) returned:' '"'line'"' 'should be return "One Line"'
558 stat = Stream(fn,'S')
559 Say 'Stream(fn,"S") returned:' '"'stat'"' 'should be return "READY"'
561 Say 'Linein(fn) returned:' '"'line'"' 'should be return ""'
562 stat = Stream(fn,'S')
563 Say 'Stream(fn,"S") returned:' '"'stat'"' 'should be return "NOTREADY"'
565 /*--------------------------------------------------------------------
566 * If Regina was invoked through the SAA interface, and the script named in
567 * the invocation did not exist, the error message did not correctly name
569 * Reported By: Jim Hasslacher, Jr.
571 * Fixed By: Jim Hasslacher, Jr.
575 /*--------------------------------------------------------------------
576 * Odd behaviour with DELWORD BIF.
577 * Line 1 gives '0' and this is correct (no '10' in the string).
578 * Line 3 makes the same string as used in line 1 and puts it into a.
579 * Line 4 now gives 3 !!!! Yet there is no '10' in there at all
580 * The rest is just to prove my point the length of the string doensn't change
581 * but after the strip all works as it should...
582 * I think the problem occurs when the first character of the searchstring and
583 * that of the deleted word are the same.
584 * MH - the problem occurs if the word following the word to be deleted is
585 * 1 character shorter than the word being deleted and starts with the
586 * same characters as the word being deleted. Seems the check for a word
587 * at the end of the string checks 1 character past the end of the string.
588 * Reported By: Thomas Zobl
590 * Fixed By: Mark Hessling
593 Say Wordpos('10','2 11 1')
596 a = Delword('2 11 10 1',3,1)
604 /*--------------------------------------------------------------------
605 * Passing a lower or mixed case variable name to RexxVariablePool() when
606 * setting a Rexx variable fails.
608 * Reported By: Bill Potvin, II
610 * Fixed By: Mark Hessling
613 Returncode = SysFileTree("*","Files.")
614 say files.0 /* always returns FILES.0 */
616 /*--------------------------------------------------------------------
617 * When registering an external function from within the API, an attempt
618 * to register a function that is already loaded results in a return code
619 * of 1 NOT the correct value of 10 (RXFUNC_DEFINED).
621 * Reported By: Bill Potvin, II
623 * Fixed By: Mark Hessling
627 /*--------------------------------------------------------------------
628 * The STREAM BIF using QUERY EXISTS incorrectly returns a file name
629 * when the file does not exist under some circumstances.
630 * If in directory e:\regina and a file exists: e:\config.sys, then
631 * Stream('e:\config.sys', 'C', 'QUERY EXISTS') returns:
632 * e:\regina\config.sys
634 * Reported By: Dennis Baeris
636 * Fixed By: Mark Hessling
640 /*--------------------------------------------------------------------
641 * The following code causes Regina to crash.
642 * Reported by: Florian Grosse-Coosmann
644 * Fixed By: Florian Grosse-Coosmann
653 say "Name =" Name || ",arg =" arg(1)
655 say "Name =" Name || ",arg =" arg(1)
659 say "Name =" Name || ",arg =" arg(1)
660 Name = "Grosse-Coosmann"
661 say "Name =" Name || ",arg =" arg(1)
664 /*--------------------------------------------------------------------
665 * When calling an external subroutine and it is found by use of
666 * REGINA_MACROS environment variable, PARSE SOURCE does not return
667 * the filename of the file.
669 * Reported By: Steve Menschel
670 * Bug Number: 19991129-86098
671 * Fixed By: Mark Hessling
675 /*--------------------------------------------------------------------
676 * Access to the external environment when using regina.dll under OS/2
678 * This was due to the way that regina.exe was incorrectly built.
680 * Reported By: Paul G Barnett
682 * Fixed By: Mark Hessling
686 /*--------------------------------------------------------------------
687 * Regina incorrectly handles DATE('L') for fractional seconds.
688 * The behaviour would result in consecutively displayed times like:
694 * Reported By: Dennis Baeris
696 * Fixed By: Mark Hessling
700 /*--------------------------------------------------------------------
701 * CALL with parameters fails in various situations with syntax error.
702 * Reported by: Dennis Baeris
704 * Fixed by: Anders Christensen
708 Call "myprog" myargs /* syntax error */
709 Call "myprog"myargs /* works */
710 Call Fred'1234' /* syntax error */
712 /*--------------------------------------------------------------------
713 * Regina incorrectly results in parse error when EXIT called with
714 * non-numeric parameter.
717 * Reported By: Dennis Baeris
718 * Bug Number: 20000323-75678
719 * Fixed By: Mark Hessling
723 /*--------------------------------------------------------------------
724 * Regina get error when calling RETURN from top-level with a
725 * non-numeric parameter.
728 * Reported By: Gerard Schildberger
729 * Bug Number: 20000325-12811
730 * Fixed By: Mark Hessling
734 /*--------------------------------------------------------------------
735 * RANDOM would only return a maximum value of 32767 on many platforms.
737 * Reported By: Alan Bardgett
738 * Bug Number: 20000128-69102
739 * Fixed By: Mark Hessling
743 /*--------------------------------------------------------------------
744 * The Regina parser incorrectly parses the sample code below, and
745 * returns the following error:
746 * Error 15 running "/home/mark/Regina-0.08h/bug030.rex", line 1: Invalid hexadecimal or binary constant
747 * Error 15.3: Only 0-9, a-f, A-F, and blank are valid in hexadecimal string; found "'<'x"
748 * Reported By: Mark Hessling
749 * Bug Number: 19991216-29512
750 * Fixed By: ??? pointed out that it is not a bug.
755 /*--------------------------------------------------------------------
756 * The Regina parser incorrectly parses the sample code below, and
757 * returns the following error:
758 * Error 14 running "/home/mark/Regina-0.08h/bug29512.rex", line 2: Incomplete DO/IF/SELECT"
759 * If the '?' is protected by parentheses, it works.
760 * Reported By: Toby ?
761 * Bug Number: 19991216-29512
765 If (?) > 0 Then say 'OK'
766 If ? > 0 Then say 'OK'
768 /*--------------------------------------------------------------------
769 * Following code still fails with syntax error.
770 * Reported by: Mark Hessling
771 * Bug Number: 20000319-63722
775 Call Fred'1234' /* syntax error */
777 /*--------------------------------------------------------------------
778 * Regina crashes with following code:
779 * Reported by: Mark Hessling
790 Return /* should return a value!! */