Re: Add remove duplicate slashes to canonicalize_path()

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Add remove duplicate slashes to canonicalize_path()
Date: 2004-11-07 02:24:28
Message-ID: 418D875C.9010904@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:

>*** 247,255 ****
> int len = strlen(path);
>
> if (len > 2 && strcmp(path + len - 2, "/.") == 0)
>- {
> trim_directory(path);
>- }
> else if (len > 3 && strcmp(path + len - 3, "/..") == 0)
> {
> trim_directory(path);
>
>
>

As a matter of style I hate this. Stripping the braces from a branch of
an if statement on the ground that it only has one statement, when other
branches might be multi-statement blocks is just downright ugly. I
thought the outcome of a recent discussion was that we would stop doing
that, at least automatically from pgindent, but I don't see any reason
to do it manually either.

cheers

andrew

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-11-07 02:35:56 Re: Add remove duplicate slashes to canonicalize_path()
Previous Message Bruce Momjian 2004-11-07 02:11:41 Add remove duplicate slashes to canonicalize_path()