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

[PATCH 2/2] Disambiguate PREFIX define in sideband.c

From
Vincent van Ravesteijn <vfr@lyx.org>
Date
Mar 6, 2012, 08:54 UTC
Message-ID
<1331024077-5736-2-git-send-email-user@vincent-VirtualBox>
In-Reply-To
<1331024077-5736-1-git-send-email-user@vincent-VirtualBox>
From: Vincent van Ravesteijn <vfr@lyx.org>

PREFIX is already used as the prefix for the system path in system_path(..) in exec_cmd.c. If PREFIX has been set, this patch prevents a warning that PREFIX is being redefined.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
---
 sideband.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sideband.c b/sideband.c
index d5ffa1c..7c38fcb 100644
--- a/sideband.c
+++ b/sideband.c
@@ -12,7 +12,7 @@
  * the remote died unexpectedly.  A flush() concludes the stream.
  */
 
-#define PREFIX "remote:"
+#define SIDEBAND_PREFIX "remote:"
 
 #define ANSI_SUFFIX "\033[K"
 #define DUMB_SUFFIX "        "
@@ -21,13 +21,13 @@
 
 int recv_sideband(const char *me, int in_stream, int out)
 {
-	unsigned pf = strlen(PREFIX);
+	unsigned pf = strlen(SIDEBAND_PREFIX);
 	unsigned sf;
 	char buf[LARGE_PACKET_MAX + 2*FIX_SIZE];
 	char *suffix, *term;
 	int skip_pf = 0;
 
-	memcpy(buf, PREFIX, pf);
+	memcpy(buf, SIDEBAND_PREFIX, pf);
 	term = getenv("TERM");
 	if (term && strcmp(term, "dumb"))
 		suffix = ANSI_SUFFIX;
-- 
1.7.5.4
Previous: Vincent van RavesteijnNext: Junio C Hamano
Message 2 of 4 in “Fix a warning about conversion to float”
  1. 1/2 Fix a warning about conversion to floatVincent van Ravesteijn, Mar 6, 2012
  2. 2/2 Disambiguate PREFIX define in sideband.cVincent van Ravesteijn, Mar 6, 2012
  3. Junio C HamanoMar 6, 2012
  4. Junio C HamanoMar 6, 2012

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.