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

[PATCH] builtin/apply.c: make a file local symbol static

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Sep 27, 2015, 18:33 UTC
Message-ID
<5608368A.4010607@ramsayjones.plus.com>

Commit dddaaab62 ("apply: convert root string to strbuf", 24-09-2015) converted a <char *str, int len> combination of variables into a single 'struct strbuf' variable. In doing so, it unintentionally increased the visibility of the variable. In order to reduce the visibility to file local, add the static keyword to the declaration of the 'root' symbol.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Jeff,

If you need to re-roll your 'jk/war-on-sprintf' series, could you please squash this into the relevant patch.

Thanks!

ATB, Ramsay Jones

 builtin/apply.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/apply.c b/builtin/apply.c
index 5dc908a..ec49658 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -77,7 +77,7 @@ static enum ws_ignore {
 
 
 static const char *patch_input_file;
-struct strbuf root = STRBUF_INIT;
+static struct strbuf root = STRBUF_INIT;
 static int read_stdin = 1;
 static int options;
 
-- 
2.5.0
Message 1 of 1 in “builtin/apply.c: make a file local symbol static”
  1. builtin/apply.c: make a file local symbol staticRamsay Jones, Sep 27, 2015

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.