httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject What the?
Date Thu, 08 Aug 1996 11:47:05 GMT
This piece of code (from mod_include.c:1044 onwards):

           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;
            }

looks decidedly odd to me - since the while unconditionally breaks at the end
of the first loop, it should have been an if, surely? Plus, it makes my
compiler warn about unreached code...

Should I change it to an if, or was the break a mistake?

Cheers,

Ben.

BTW, essentially identical code appears about 100 lines later, too.

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.            Apache Group member (http://www.apache.org)

Mime
View raw message