Re: Add remove duplicate slashes to canonicalize_path() - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Add remove duplicate slashes to canonicalize_path()
Date
Msg-id 200411070235.iA72Zv816324@candle.pha.pa.us
Whole thread Raw
In response to Re: Add remove duplicate slashes to canonicalize_path()  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan wrote:
>
>
> 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.

Right, we aren't doing it automatically.  Manually it seemed OK.  What
is our consensus on this?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Add remove duplicate slashes to canonicalize_path()
Next
From: Markus Bertheau
Date:
Subject: Re: contrib/xml2: add function xml_encode_special_chars