Skip to content
Tcl Source Code History Of Ticket 219829ffffffffff
Login

History Of Ticket 219829ffffffffff

Artifacts Associated With Ticket 219829ffffffffff

  1. Ticket change [71d926d535] (rid 100750) by drh on 2000-10-31 02:17:44:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The command:
      
         puts [subst {[return {}; should be invisible]}]
      
      outputs nothing in Tcl8.0 as I would expect.  But
      it outputs "should be invisible]" in 8.3.0 and in
      8.4a2.
      
      In general, a "return" statement within [...] inside
      a subst causes the scanning of text inside the [...]
      to stop immediately, rather than continuing on to the
      closing ']'.  I do not have a fix at this time.
      
      This comes up when using "subst" to embed TCL in 
      web pages (for example in tclhttpd).  The work-
      around is to do
      
           [if 1 {...}]
      
      in place of
      
           [...]
      
      
    4. foundin initialized to: "obsolete: 8.4a2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "drh"
    9. subsystem initialized to: "81. Bundled Packages"
    10. title initialized to: ""subst" processes "return" incorrectly"
    11. type initialized to: "Bug"
  2. Ticket change [e04e1ecf01] (rid 115163) by hobbs on 2000-11-01 00:46:47:

    1. icomment:
      This seems to have cropped up specifically in 8.2 somewhere.
      If I use 8.2b2, I get really weird results:
      
      % info patch
      8.2b2
      % subst {[return {}; should be invisible]}
      can't read "i": no such variable
      % subst {[return {}; should be invisible]}
      1o_pa
      
      Whereas 8.2.3-8.4a has saner, but incorrect behavior:
      
      % info patch
      8.2.3
      % subst {[return {}; should be invisible]}
      should be invisible]
      
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. username: "hobbs"
  3. Ticket change [7a6a54e3ec] (rid 90313) by hobbs on 2000-11-02 04:45:26:

    1. closedate changed to: "2000-11-01T21:45:26"
    2. closer changed to: "hobbs"
    3. icomment:
      Fixed with the following patch.  There was varying behavior from 7.6 to 8.2 that (in 8.0+) was all broken in one way or another.  The following allows for the best effort, keeping close compatability with 7.6.
      
      cvs diff -bc generic/tclParse.c
      Index: generic/tclParse.c
      ===================================================================
      RCS file: /home/cvs/external/tcl/generic/tclParse.c,v
      retrieving revision 1.13
      diff -b -c -r1.13 tclParse.c
      *** tclParse.c  1999/11/10 02:51:57     1.13
      --- tclParse.c  2000/11/01 21:43:50
      ***************
      *** 1456,1470 ****
              Tcl_DecrRefCount(objv[i]);
            }
            if (gotParse) {
      !       p = parse.commandStart + parse.commandSize;
              Tcl_FreeParse(&parse);
      !       if ((nested != 0) && (p > script) && (p[-1] == ']')) {
                  /*
                   * We get here in the special case where the TCL_BRACKET_TERM
      !            * flag was set in the interpreter and we reached a close
      !            * bracket in the script.  Return immediately.
                   */
        
                  iPtr->termOffset = (p - 1) - script;
              } else {
                  iPtr->termOffset = p - script;
      --- 1456,1506 ----
              Tcl_DecrRefCount(objv[i]);
            }
            if (gotParse) {
      !       next = parse.commandStart + parse.commandSize;
      !       bytesLeft -= next - p;
      !       p = next;
              Tcl_FreeParse(&parse);
      ! 
      !       if ((nested != 0) && (p > script)) {
      !           char *nextCmd = NULL;       /* pointer to start of next command */
      ! 
                  /*
                   * We get here in the special case where the TCL_BRACKET_TERM
      !            * flag was set in the interpreter.
      !            *
      !            * At this point, we want to find the end of the script
      !            * (either end of script or the closing ']').
      !            */
      ! 
      !           while ((p[-1] != ']') && bytesLeft) {
      !               if (Tcl_ParseCommand(NULL, p, bytesLeft, nested, &parse)
      !                       != TCL_OK) {
      !                   /*
      !                    * We were looking for the ']' to close the script.
      !                    * But if we find a syntax error, it is ok to quit
      !                    * early since in that case we no longer need to know
      !                    * where the ']' is (if there was one).  We reset the
      !                    * pointer to the start of the command that after the
      !                    * one causing the return.  -- hobbs
                           */
        
      +                   p = (nextCmd == NULL) ? parse.commandStart : nextCmd;
      +                   break;
      +               }
      + 
      +               if (nextCmd == NULL) {
      +                   nextCmd = parse.commandStart;
      +               }
      + 
      +               /*
      +                * Advance to the next command in the script.
      +                */
      + 
      +               next = parse.commandStart + parse.commandSize;
      +               bytesLeft -= next - p;
      +               p = next;
      +               Tcl_FreeParse(&parse);
      +           }
                  iPtr->termOffset = (p - 1) - script;
              } else {
                  iPtr->termOffset = p - script;
      
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"
  4. Ticket change [63942b48a3] (rid 92601) by dgp on 2001-04-05 08:06:24:

    1. closedate changed to: "2001-04-05T01:06:24"
    2. closer changed to: "dgp"
    3. subsystem changed to: "45. Parsing and Eval"
    4. title changed to: ""subst" processes "return" incorrectly"