Thread (5 messages) flat view 5 messages, 4 authors, 2016-06-15
STALE3751d

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

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 23:08:08
Subsystem: the rest · Maintainer: Linus Torvalds

Noticed-by: Ole Tange [off-list ref]
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 On Sun, Feb 7, 2016 at 4:56 AM, Ole Tange [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help