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

[PATCH] make_nonrelative_path: Use is_absolute_path()

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Jun 8, 2008, 14:34 UTC
Message-ID
<200806081634.40882.johannes.sixt@telecom.at>
This helps porting to Windows.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 path.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/path.c b/path.c
index 7c3b89a..5da41c7 100644
--- a/path.c
+++ b/path.c
@@ -321,7 +321,7 @@ const char *make_nonrelative_path(const char *path)
 {
 	static char buf[PATH_MAX + 1];
 
-	if (path[0] == '/') {
+	if (is_absolute_path(path)) {
 		if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
 			die ("Too long path: %.*s", 60, path);
 	} else {
-- 
1.5.6.rc2.6.g3056b
Message 1 of 1 in “make_nonrelative_path: Use is_absolute_path()”
  1. make_nonrelative_path: Use is_absolute_path()Johannes Sixt, Jun 8, 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.