You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1997/07/06 07:36:23 UTC

mod_include loops

There are two loops in mod_include similar to:

            if (current == (struct parse_node*)NULL) {
                root = current = new;
                break;
            }
            /* Percolate upwards */
            while (current != (struct parse_node *)NULL) {
                switch(current->token.type) {
                  case token_not:
                  case token_eq:
                  case token_ne:
                  case token_and:
                  case token_or:
                  case token_lbrace:
                    break;
                  default:
                    log_printf(r->server,
                        "Invalid expression %s", expr, r->filename);
                    rputs(error, r);
                    goto RETURN;
                }
                break;
            }

They cause Sun's SC4.2 to complain about end of loop code not
being reached.  For some reason, when I looked at the loop
before, the loop looked fine.

Obviously, it isn't.  The while() does absolutely nothing, and could be 
taken out, ie. simply leave the body in.  

The reason the loop is that way is presumably so it is in the same
form as a bunch of other ones where it does matter.  Is it worth
bothering with?