From: Eric Sunshine <sunshine@sunshineco.com>
To: Rose via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Rose <83477269+AtariDreams@users.noreply.github.com>,
Seija Kijin <doremylover123@gmail.com>
Subject: Re: [PATCH] grep: simplify is_empty_line
Date: Thu, 29 Dec 2022 12:06:04 -0500 [thread overview]
Message-ID: <CAPig+cSFAUcU74qULYkN7OX4-OqU_3VJeTdb1ZH_QoOW9FBwZQ@mail.gmail.com> (raw)
In-Reply-To: <pull.1418.git.git.1672333122193.gitgitgadget@gmail.com>
On Thu, Dec 29, 2022 at 12:00 PM Rose via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> diff --git a/grep.c b/grep.c
> @@ -1483,9 +1483,10 @@ static int fill_textconv_grep(struct repository *r,
> static int is_empty_line(const char *bol, const char *eol)
> {
> - while (bol < eol && isspace(*bol))
> - bol++;
> - return bol == eol;
> + while (bol < eol)
> + if (!isspace(*bol))
> + return 0;
> + return 1;
> }
The rewritten code appears to be quite broken. It never increments `bol`.
next prev parent reply other threads:[~2022-12-29 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-29 16:58 [PATCH] grep: simplify is_empty_line Rose via GitGitGadget
2022-12-29 17:06 ` Eric Sunshine [this message]
2022-12-29 17:18 ` [PATCH v2] " Rose via GitGitGadget
2022-12-29 17:45 ` Eric Sunshine
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=CAPig+cSFAUcU74qULYkN7OX4-OqU_3VJeTdb1ZH_QoOW9FBwZQ@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=83477269+AtariDreams@users.noreply.github.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).