Received: (qmail 2278 invoked by uid 2012); 22 Dec 1998 16:15:51 -0000 Message-Id: <19981222161551.2277.qmail@hyperreal.org> Date: 22 Dec 1998 16:15:51 -0000 From: Vincent Gailliez Reply-To: vincent.gailliez@systemat.lu To: apbugs@hyperreal.org Subject: Always message "Expected but saw " when starting Apache. X-Send-Pr-Version: 3.2 >Number: 3576 >Category: general >Synopsis: Always message "Expected but saw " when starting Apache. >Confidential: no >Severity: critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Tue Dec 22 08:20:01 PST 1998 >Last-Modified: Tue Dec 22 08:21:42 PST 1998 >Originator: vincent.gailliez@systemat.lu >Organization: >Release: 1.3.2 and 1.3.3 >Environment: OS : AIX 4.3.2 Compiler : C Compiler 4.4c Uname -a : AIX bilbo 3 4 001100044C00 >Description: I have always the message "Expected but saw " (where xxx is Directory, File, VirtualHost, ... in httpd.conf, access.conf, srm.conf) when starting Apache (apachectl start). The problem come from src/main/httpd_core.c when Apache compare 2 strings in the function end_nested_section() with the operator != to compare the 2 string pointers. When I replace this comparison with a string comparison strcmp(), it's work. (Sorry for my english) if (cmd->cmd->name != cmd->end_token) { return ap_pstrcat(cmd->pool, "Expected ", cmd->end_token, " but saw ", cmd->cmd->name, NULL); } ==========>>>>>>>>>>>> if (strcmp(cmd->cmd->name,cmd->end_token)) { return ap_pstrcat(cmd->pool, "Expected ", cmd->end_token, " but saw ", cmd->cmd->name, NULL); } >How-To-Repeat: Yes, see the source of http_core.c >Fix: Replace the comparison != with a string compare strcmp() in the function end_nested_section() (in http_core.c). >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: marc State-Changed-When: Tue Dec 22 08:21:42 PST 1998 State-Changed-Why: Please search tbe bugdb for previous reports of this. The pointer comparison is correct; the resaon it isn't working for you is that there is a bug in your compiler. Use gcc. There should also be patches available for your compiler; search for the pervious PRs on this for details. >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]