On Thu, 2 Oct 2003, Jeff Trawick wrote:
> I'm quite happy that
> [httpd-2.0] $ find . -name '*.c' | xargs grep '^[ \t]+{'
> currently produces no output, and I'd prefer that it stay that way ;)
That it does, but
[httpd-2.0] $ find . -name '*.c' | xargs egrep '^[ \t]+{'
(note the 'e' on egrep) produces quite a lot of output, much of which is
the kind of thing I'm talking about.
I am NOT saying opening braces can or should be on their own line for
regular code. ONLY when they follow a conditional expression that spans
lines.
So, for example, this snippet from server/util.c is and would remain
incorrect:
else if (!strcmp(cmd->path, "/") == 0)
{
Whereas this other snippet from server/util.c would become officially
okay:
if (r->server->path
&& !strncmp(r->uri, r->server->path, r->server->pathlen)
&& (r->server->path[r->server->pathlen - 1] == '/'
|| r->uri[r->server->pathlen] == '/'
|| r->uri[r->server->pathlen] == '\0'))
{
--Cliff