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

Re: [PATCH] config.c: Expand $HOME and tilde character in core.excludesfile

From
Wayne Davison <wayne@opencoder.net>
Date
Jan 28, 2008, 23:52 UTC
Message-ID
<20080128235205.GE8669@blorf.net>
In-Reply-To
<y7a9aaem.fsf@blue.sea.net>
On Mon, Jan 28, 2008 at 11:49:05PM +0200, Jari Aalto wrote:
> +                        ret = str_replace(str, "~", home);
This would mangle a name with a tilde in it, e.g. "file.c~", etc.
> +                        ret = str_replace(str, "$HOME", home);
This would affect similarly named vars, e.g. $HOMER, etc.
> +                strcat( ptr, "");   /* Terminate with null string */

Calling strcat() requires a null-terminated string. Instead, assign a '\0' char at the right position.

..wayne..
Previous: Miles Bader
Message 7 of 7 in “config.c: Expand $HOME and tilde character in core.excludesfile”
  1. config.c: Expand $HOME and tilde character in core.excludesfileJari Aalto, Jan 28, 2008
  2. Johannes SchindelinJan 28, 2008
  3. Jakub NarebskiJan 28, 2008
  4. Miles BaderJan 29, 2008
  5. David SymondsJan 29, 2008
  6. Miles BaderJan 29, 2008
  7. Wayne DavisonJan 28, 2008

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.