From: Maxime Devos <maximedevos@telenet.be>
To: Vijay Marupudi <vijay@vijaymarupudi.com>, guile-devel@gnu.org
Subject: Re: [PATCH] Enable utf8->string to take a range
Date: Fri, 21 Jan 2022 17:53:23 +0100 [thread overview]
Message-ID: <cd12718b350982905678be78d6f751d26a714219.camel@telenet.be> (raw)
In-Reply-To: <87h79x6abc.fsf@vijaymarupudi.com>
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
Vijay Marupudi schreef op do 20-01-2022 om 22:23 [-0500]:
> + c_start = scm_to_size_t (start);
> + if (SCM_UNLIKELY (c_start >= c_len))
> + {
> + scm_out_of_range (FUNC_NAME, start);
> + }
> +
> + if (!scm_is_eq (end, SCM_UNDEFINED))
> + {
> + c_end = scm_to_size_t (end);
> + if (SCM_UNLIKELY (c_end > c_len))
> + scm_out_of_range (FUNC_NAME, end);
IIUC, this will cause an out-of-range error for the following:
(utf8->string "" 0 0)
However, the following works:
(substring "" 0 0) ; -> empty string
There seems to be an inconsistency here. Can (c_start >= c_len) be
relaxed to c_start > c_len?
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2022-01-21 16:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 3:23 [PATCH] Enable utf8->string to take a range Vijay Marupudi
2022-01-21 16:53 ` Maxime Devos [this message]
2022-01-21 16:54 ` Maxime Devos
2022-01-21 16:55 ` Maxime Devos
2022-01-21 17:04 ` Maxime Devos
2022-01-21 20:20 ` Vijay Marupudi
2022-01-21 22:08 ` Maxime Devos
2022-01-22 1:21 ` Vijay Marupudi
2022-03-09 13:20 ` Maxime Devos
2022-03-09 13:20 ` Maxime Devos
2022-03-09 13:24 ` Maxime Devos
2022-03-09 13:27 ` Maxime Devos
2022-03-09 13:35 ` Maxime Devos
2022-03-09 14:50 ` Vijay Marupudi
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cd12718b350982905678be78d6f751d26a714219.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=guile-devel@gnu.org \
--cc=vijay@vijaymarupudi.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 read-only IMAP folder(s) and NNTP newsgroup(s).