Skip to content

Commit 47ff714

Browse files
thefallentreeclaude
andcommitted
ftpdsupp.h: count ranges from the end with < (4 places)
sites[0][10..-1], site[l1-l2..-1], sites[i][1..-1], sites[i][l2..-1] returned an empty string here (FluffOS counts from the end with <), so the 'sitecheck' parsing and the '*.domain' / 'domain.*' matching never matched. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 51396a2 commit 47ff714

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/net/ftpdsupp.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int check_site(string who, int fd) {
199199
sites = explode(arg, "\n");
200200
sites = regexp(sites, "^sitecheck ");
201201
if (sites && sizeof(sites)) {
202-
arg = sites[0][10..-1];
202+
arg = sites[0][10..<1];
203203

204204
/*
205205
* parse command line args
@@ -264,8 +264,8 @@ int check_site(string who, int fd) {
264264
l2 = strwidth(sites[i]) - 1;
265265
if (l2 > 1 && l1 > l2 &&
266266
sites[i][0..1] == "*." &&
267-
strcmp(site[l1-l2..-1],
268-
sites[i][1..-1]) == 0)
267+
strcmp(site[l1-l2..<1],
268+
sites[i][1..<1]) == 0)
269269
return 1;
270270
}
271271

@@ -277,7 +277,7 @@ int check_site(string who, int fd) {
277277
while (i--) {
278278
l2 = strwidth(sites[i]) - 2;
279279
if (l2 > 0 && l1 > l2 &&
280-
sites[i][l2..-1] == ".*" &&
280+
sites[i][l2..<1] == ".*" &&
281281
strcmp(site[0..l2],
282282
sites[i][0..l2]) == 0)
283283
return 1;

0 commit comments

Comments
 (0)