git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: ole@tange.dk, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG
Date: Sun,  7 Feb 2016 06:23:12 +0700	[thread overview]
Message-ID: <1454800992-15953-1-git-send-email-pclouds@gmail.com> (raw)
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

  reply	other threads:[~2016-02-06 23:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 21:56 git diff HEAD^(255) fails Ole Tange
2016-02-06 23:23 ` Nguyễn Thái Ngọc Duy [this message]
2016-02-07 12:23   ` [PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG Johannes Schindelin
2016-02-08  5:16     ` [PATCH] Avoid interpreting too-long parameter as file name Nguyễn Thái Ngọc Duy
2016-02-08 20:46       ` Junio C Hamano
2016-02-23 20:58 ` git diff HEAD^(255) fails Kevin Daudt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454800992-15953-1-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ole@tange.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).