Re: [PATCH] fix strverscmp comparison of digit sequence with non-digits

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Jan  8 06:56, Brian Inglis wrote:
> >From: Rich Felker <[email protected]>
> Date: Mon, 7 Nov 2022 22:17:55 -0500
> 
> the rule that longest digit sequence not beginning with a zero is
> greater only applies when both sequences being compared are
> non-degenerate. this is spelled out explicitly in the man page, which
> may be deemed authoritative for this nonstandard function: "If one or
> both of these is empty, then return what strcmp(3) would have
> returned..."
> 
> we were wrongly treating any sequence of digits not beginning with a
> zero as greater than a non-digit in the other string.
> 
> Signed-off-by: Brian Inglis <[email protected]>
> ---
>  newlib/libc/string/strverscmp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Pushed.

Thanks,
Corinna
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.