feat(libcurl): implement curl_strequal and curl_strnequal #14337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14337"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by danielhorngt on 2026-11-01T09:59:57Z.
What
Implements
curl_strequal(NIDCDG6wR08Ntw) andcurl_strnequal(NIDOJiHNjSOguc) in libcurl, which threw until now. The signatures follow curl's public API and the matching follows strcase.c:curl_strnequalcompares at mostmaxbytes, and returns 1 whenmaxis 0.A null argument throws through
NotImplemented_nid_no_patch. The module's curl version is unknown and curl differs: 7.73 dereferences the pointer, while 8.10 treats two nulls as equal. The debt entry records this.libcurl gains a
CMakeLists.txtso it can register a test. It builds the same single source as the default rule.Tested
Windows 11, WinLibs GCC 15.2.0, Release, at this PR's commit. No title or homebrew was run; I found no title that calls these exports. The logic is plain byte comparison with no platform-specific code.
ctest -R '^guest_curl_strings$': passes. The cases cover case folding, length differences, the bytes next to the letter ranges (@,`,[,{), non-ASCII bytes,maxof 0,maxstopping before a mismatch andmaxpast the terminator. The null path is not tested, because it is a deliberately unsupported path.ctest -R '^public_headers|curl': 66 of 66 pass.cmake --build build --target libs: passes.max == 0return failed the test, and so did widening the folded range to include`. Both were reverted. These ran before the null checks were removed; the checks that caught them are unchanged.check_conventions.py --base upstream/mainpasses, andpr_overlap.py --branch feat/curl-strequalreports no overlap with open pull requests.Not run: the full test suite, Linux, macOS, or any comparison with a console.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:47:00Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T06:13:14Z.
Review: COMMENTED
Reviewed — no blocking findings
curl_strequalandcurl_strnequalnow compare strings case-insensitively for ASCII letters only, and they stop at NUL. A null argument throws, as the debt entry says. The new guest test passed on the Windows runner, and the test's expected values match the code as read.What I ran
d26099a97dfc5a4c6967e09b11b1ed7d9b1ded25; base26fa1212b82f76dd49cf12d65e445d6ff3e0844c. 5 files, +94/-9:libcurl/Export.cpp(the two functions, plus aRawUpperhelper),libcurl/CMakeLists.txt(new: the library and the guest test),libcurl/include/InventoryExports.hpp(two declarations get parameters),core/libs/tests/GuestCurlStrings.cpp(new, 49 lines), anddocs/dev/debt/libcurl.md(a new section for the two functions, and two NIDs moved out of the table).guest_curl_strings(Test #2709, passed, 0.02 s). The run reports 100% of 2583.Results
curl_strequalandcurl_strnequallogicRawUpper; both loops stop at NUL;max == 0returns 1GuestCurlStrings.cppfollows from the code as readguest_curl_strings(hosted, Windows)Test #2709, 0.02 sRead-only check output
Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: passed (85 symbols). Stack check: passed. Hosted:
gh api repos/boykopovar/AnyPS5/commits/d26099a97dfc5a4c6967e09b11b1ed7d9b1ded25/check-runs, and the Windows job log.Negative control
Not run here. A negative control needs a local build, and code from this head is not run here.
Findings
Blocking
None.
Non-blocking
None.
Sources
github.com/boykopovar/AnyPS5@d26099a97d/core/libs/prx/libcurl/Export.cppgithub.com/boykopovar/AnyPS5@d26099a97d/core/libs/tests/GuestCurlStrings.cppgithub.com/boykopovar/AnyPS5@d26099a97d/core/libs/prx/libcurl/CMakeLists.txtgithub.com/boykopovar/AnyPS5@d26099a97d/docs/dev/debt/libcurl.mdwindowsond26099a97dNot verified
To get this to a good state