git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] strbuf: add strbuf_add_real_path()

From
BWBrandon Williams <bmwill@google.com>
Date
Feb 28, 2017, 20:42 UTC
Message-ID
<20170228204209.GA110257@google.com>
In-Reply-To
<3063b6fb-02aa-703c-0b56-300109cf054d@web.de>
On 02/27, René Scharfe wrote:
Show 23 quoted lines
> Am 27.02.2017 um 19:22 schrieb Brandon Williams:
> >On 02/25, René Scharfe wrote:
> >>+void strbuf_add_real_path(struct strbuf *sb, const char *path)
> >>+{
> >>+	if (sb->len) {
> >>+		struct strbuf resolved = STRBUF_INIT;
> >>+		strbuf_realpath(&resolved, path, 1);
> >>+		strbuf_addbuf(sb, &resolved);
> >>+		strbuf_release(&resolved);
> >>+	} else
> >>+		strbuf_realpath(sb, path, 1);
> >
> >I know its not required but I would have braces on the 'else' branch
> >since they were needed on the 'if' branch.  But that's up to you and
> >your style :)
> 
> Personally I'd actually prefer them as well, but the project's style
> has traditionally been to avoid braces on such trailing single-line
> branches to save lines.  The CodingGuidelines for this topic have
> been clarified recently, though, and seem to require them now.
> Interesting.
> 
> René

Having the project's guidelines align with your own preference makes things a bit easier!

-- 
Brandon Williams
Previous: René Scharfe
Message 5 of 5 in “strbuf: add strbuf_add_real_path()”
  1. strbuf: add strbuf_add_real_path()René Scharfe, Feb 25, 2017
  2. Jeff KingFeb 25, 2017
  3. Brandon WilliamsFeb 27, 2017
  4. René ScharfeFeb 27, 2017
  5. Brandon WilliamsFeb 28, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.