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

[PATCH v2 40/86] environment: replace prefixcmp() with starts_with()

From
Christian Couder <chriscool@tuxfamily.org>
Date
Nov 17, 2013, 22:06 UTC
Message-ID
<20131117220719.4386.73779.chriscool@tuxfamily.org>
In-Reply-To
<20131117215732.4386.19345.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 environment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index 378254c..1270278 100644
--- a/environment.c
+++ b/environment.c
@@ -176,7 +176,7 @@ const char *get_git_namespace(void)
 
 const char *strip_namespace(const char *namespaced_ref)
 {
-	if (prefixcmp(namespaced_ref, get_git_namespace()) != 0)
+	if (!starts_with(namespaced_ref, get_git_namespace()))
 		return NULL;
 	return namespaced_ref + namespace_len;
 }
-- 
1.8.4.1.561.g12affca
Previous: Christian CouderNext: Christian Couder
Message 5 of 6 in “replace prefixcmp() with starts_with()”
  1. 00/86 replace prefixcmp() with starts_with()Christian Couder, Nov 17, 2013
  2. 01/86 strbuf: add starts_with() to be used instead of prefixcmp()Christian Couder, Nov 17, 2013
  3. 02/86 diff: replace prefixcmp() with starts_with()Christian Couder, Nov 17, 2013
  4. 08/86 transport*: replace prefixcmp() with starts_with()Christian Couder, Nov 17, 2013
  5. 40/86 environment: replace prefixcmp() with starts_with()Christian Couder, Nov 17, 2013
  6. 86/86 strbuf: remove prefixcmp() as it has been replaced with starts_with()Christian Couder, Nov 17, 2013

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.