[PATCH] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread Alejandro Colomar
And use it where the same logic was being open-coded. Cc: "G. Branden Robinson" Signed-off-by: Alejandro Colomar --- Hi Branden, Now this looks better. After this change, it seems to me more clear that using 1 as the minimum is fine, since it only results in a warning, and not in an error, so

[PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread Alejandro Colomar
And use it where the same logic was being open-coded. While at it, fix the logic, which was incorrect in the open-coded call sites, since for an input of 1, it produced 3, but the first prime is 2. Also, since this is a library function, let's behave well for an input of 0, and return also the fi

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread G. Branden Robinson
Hi Alex, At 2024-03-13T11:21:55+0100, Alejandro Colomar wrote: > And use it where the same logic was being open-coded. > > While at it, fix the logic, which was incorrect in the open-coded call > sites, since for an input of 1, it produced 3, but the first prime is 2. Are you sure? That sounds

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread G. Branden Robinson
Forgot to attach my working copy, of course. At 2024-03-13T05:45:12-0500, G. Branden Robinson wrote: > Hi Alex, > > At 2024-03-13T11:21:55+0100, Alejandro Colomar wrote: > > And use it where the same logic was being open-coded. > > > > While at it, fix the logic, which was incorrect in the open-

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread Alejandro Colomar
On Wed, Mar 13, 2024 at 05:45:10AM -0500, G. Branden Robinson wrote: > Hi Alex, Hi Branden, > At 2024-03-13T11:21:55+0100, Alejandro Colomar wrote: > > And use it where the same logic was being open-coded. > > > > While at it, fix the logic, which was incorrect in the open-coded call > > sites,

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread Alejandro Colomar
Hi Branden, On Wed, Mar 13, 2024 at 05:46:38AM -0500, G. Branden Robinson wrote: > Forgot to attach my working copy, of course. You could have attached/inlined a diff; it would be smaller. :) > /* Copyright (C) 1989-2020 Free Software Foundation, Inc. > Written by James Clark (j...@jclark.

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread G. Branden Robinson
Hi Alex, At 2024-03-13T12:01:32+0100, Alejandro Colomar wrote: > I didn't write an exploit, as that would be a little bit more work > (including learning what is indxbib at all). Go ahead! This, I want to see! 3:) > But by reading the code, I'd say yes. > > $ git show master:src/utils/indxbib

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread Alejandro Colomar
Hi Branden, On Wed, Mar 13, 2024 at 06:52:10AM -0500, G. Branden Robinson wrote: > Hi Alex, > > At 2024-03-13T12:01:32+0100, Alejandro Colomar wrote: > > I didn't write an exploit, as that would be a little bit more work > > (including learning what is indxbib at all). > > Go ahead! This, I wan

Unable to generate glyphs for chinese letters

2024-03-13 Thread Alejandro Colomar
Hi Deri, I've noticed another similar issue, this time with Chinese. I see chinese letters in the bookmarks, but they don't appear in the PDF body. If I read the manual page in the terminal, I do see them. When generating the PDF, I get a bunch of warnings about special characters not defined.

Re: Unable to generate glyphs for chinese letters

2024-03-13 Thread Alejandro Colomar
On Wed, Mar 13, 2024 at 02:25:51PM +0100, Alejandro Colomar wrote: > Hi Deri, > > I've noticed another similar issue, this time with Chinese. You can find the PDF here: --

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread James K. Lowden
On Wed, 13 Mar 2024 06:52:10 -0500 "G. Branden Robinson" wrote: > A hash table (or map) of size 1 is not a hash table, it's a list. A container does not change its type based on its size. I don't know what you're trying to fix here, but it sounds unimportant. If the user is creating, let us

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread G. Branden Robinson
Hi James, At 2024-03-12T15:28:22-0400, James K. Lowden wrote: > On Wed, 13 Mar 2024 06:52:10 -0500 > "G. Branden Robinson" wrote: > > > A hash table (or map) of size 1 is not a hash table, it's a list. > > A container does not change its type based on its size. Indeed not. I was speaking at

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n

2024-03-13 Thread James K. Lowden
On Wed, 13 Mar 2024 13:00:57 -0500 "G. Branden Robinson" wrote: > > If the user is creating, let us say, unnecessary or > > counterproductive overhead by calling for a map of size 1, is that > > ever a problem in practice? > > It was easier to "ban" it as silly (an invalid option argument valu