git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Rose via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Seija Kijin <doremylover123@gmail.com>
Subject: Re: [PATCH] Explicitly set errno to ENOENT if err is not ERROR_DIRECTORY
Date: Mon, 19 Dec 2022 19:33:52 +0100	[thread overview]
Message-ID: <221219.86mt7jxmwd.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <pull.1402.git.git.1671465108414.gitgitgadget@gmail.com>


On Mon, Dec 19 2022, Rose via GitGitGadget wrote:

> From: Seija Kijin <doremylover123@gmail.com>
>
> At this point, the only two possible errors are
> ERROR_DIRECTORY or ERROR_BAD_PATHNAME.
>
> This code clarifies this and also saves a call to
> err_win_to_posix.
>
> Signed-off-by: Seija Kijin <doremylover123@gmail.com>
> ---
>     Explicitly set errno to ENOENT if err is not ERROR_DIRECTORY
>     
>     At this point, the only two possible errors are ERROR_DIRECTORY or
>     ERROR_BAD_PATHNAME.
>     
>     This code clarifies this and also saves a call to err_win_to_posix.
>     
>     Signed-off-by: Seija Kijin doremylover123@gmail.com
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1402%2FAtariDreams%2Fopendir-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1402/AtariDreams/opendir-v1
> Pull-Request: https://github.com/git/git/pull/1402
>
>  compat/win32/dirent.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/compat/win32/dirent.c b/compat/win32/dirent.c
> index 52420ec7d4d..8f94a5ab6db 100644
> --- a/compat/win32/dirent.c
> +++ b/compat/win32/dirent.c
> @@ -34,13 +34,13 @@ DIR *opendir(const char *name)
>  	if (len && !is_dir_sep(pattern[len - 1]))
>  		pattern[len++] = '/';
>  	pattern[len++] = '*';
> -	pattern[len] = 0;
> +	pattern[len] = '\0';

Maybe the subject of this patch is a good change (I have no idea, and
don't use Windows), but this just seems like unrelated general cleanup.

I think it's probably good to change these sorts cases from 0 to '\0',
but let's do that as a seperate change...

      parent reply	other threads:[~2022-12-19 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 15:51 [PATCH] Explicitly set errno to ENOENT if err is not ERROR_DIRECTORY Rose via GitGitGadget
2022-12-19 16:20 ` [PATCH v2] win32: explicitly set errno to enoent if err is not error_directory Rose via GitGitGadget
2022-12-20  7:21   ` Johannes Sixt
2022-12-19 18:33 ` Ævar Arnfjörð Bjarmason [this message]

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=221219.86mt7jxmwd.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=doremylover123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /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).