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

[PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 6, 2016, 23:23 UTC
Message-ID
<1454800992-15953-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<CA+4vN7w2=JWusWDhhGNzAkJbE-s44G4WoXdvf26yzvtYfpktfQ@mail.gmail.com>
Noticed-by: Ole Tange <ole@tange.dk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 On Sun, Feb 7, 2016 at 4:56 AM, Ole Tange <ole@tange.dk> wrote:
 > If file name too long it should just try to see if it is a reference
 > to a revision.
 Looks easy enough to fix.
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.c b/setup.c
index 2c4b22c..ab8f85d 100644
--- a/setup.c
+++ b/setup.c
@@ -147,7 +147,7 @@ int check_filename(const char *prefix, const char *arg)
 		name = arg;
 	if (!lstat(name, &st))
 		return 1; /* file exists */
-	if (errno == ENOENT || errno == ENOTDIR)
+	if (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)
 		return 0; /* file does not exist */
 	die_errno("failed to stat '%s'", arg);
 }
-- 
2.7.0.377.g4cd97dd
Previous: Ole TangeNext: Johannes Schindelin
Message 2 of 6 in “git diff HEAD^(255) fails”
  1. Ole TangeFeb 6, 2016
  2. setup.c: make check_filename() return 0 on ENAMETOOLONGNguyễn Thái Ngọc Duy, Feb 6, 2016
  3. Johannes SchindelinFeb 7, 2016
  4. Avoid interpreting too-long parameter as file nameNguyễn Thái Ngọc Duy, Feb 8, 2016
  5. Junio C HamanoFeb 8, 2016
  6. Kevin DaudtFeb 23, 2016

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.