Skip to content

fix(nntp): handle open-ended OVER range like '5-'#75

Merged
ralyodio merged 1 commit into
profullstack:mainfrom
forgou37:fix/nntp-over-open-ended-range
Jul 3, 2026
Merged

fix(nntp): handle open-ended OVER range like '5-'#75
ralyodio merged 1 commit into
profullstack:mainfrom
forgou37:fix/nntp-over-open-ended-range

Conversation

@forgou37

@forgou37 forgou37 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

The NNTP OVER command with an open-ended range like 5- (meaning "all articles from 5 to end") currently returns 0 articles.

Root cause: parseRange("5-") splits on -["5", ""]. strconv.ParseInt("", 10, 64) returns an error, so the function falls through to return 0, 0 instead of returning (5, math.MaxInt64).

Fix

Check for empty parts[1] before attempting to parse it — treat it as an open-ended range (math.MaxInt64).

OVER 5-   →  articles 5..MaxInt64  ✓  (was returning empty)
OVER 5-10 →  articles 5..10       ✓  (unchanged)
OVER 5    →  articles 5..5        ✓  (unchanged)
OVER      →  articles 0..MaxInt64 ✓  (unchanged)

Related ugig gig: https://ugig.net/gigs/14eb1fad-1c95-4ba9-bd6f-5b6f9de1a664

@ralyodio ralyodio merged commit 6a086eb into profullstack:main Jul 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants