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

[PATCH] utf8.c: mark utf{16,32}_{be,le}_bom symbols static

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Jan 4, 2018, 17:20 UTC
Message-ID
<e96a7a50-9d4f-c1d6-ecd7-f967b102b58a@ramsayjones.plus.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Lars,

If you need to re-roll your 'ls/checkout-encoding' branch, could you please squash this into the relevant patch (commit d5318db2d0, "utf8: add function to detect prohibited UTF-16/32 BOM", 2017-12-31).

[yes, noticed by sparse].
Thanks!

ATB, Ramsay Jones

 utf8.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/utf8.c b/utf8.c
index 1978d6c42..f033fec1c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -544,10 +544,10 @@ static int has_bom_prefix(const char *data, size_t len,
 	return (len >= bom_len) && !memcmp(data, bom, bom_len);
 }
 
-const char utf16_be_bom[] = {0xFE, 0xFF};
-const char utf16_le_bom[] = {0xFF, 0xFE};
-const char utf32_be_bom[] = {0x00, 0x00, 0xFE, 0xFF};
-const char utf32_le_bom[] = {0xFF, 0xFE, 0x00, 0x00};
+static const char utf16_be_bom[] = {0xFE, 0xFF};
+static const char utf16_le_bom[] = {0xFF, 0xFE};
+static const char utf32_be_bom[] = {0x00, 0x00, 0xFE, 0xFF};
+static const char utf32_le_bom[] = {0xFF, 0xFE, 0x00, 0x00};
 
 int has_prohibited_utf_bom(const char *enc, const char *data, size_t len)
 {
-- 
2.15.0
Message 1 of 1 in “utf8.c: mark utf{16,32}_{be,le}_bom symbols static”
  1. utf8.c: mark utf{16,32}_{be,le}_bom symbols staticRamsay Jones, Jan 4, 2018

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.