Non-ASCII single -O drops hts-log.txt into a mangled twin directory on Windows#636
Merged
Conversation
… keeps hts-log.txt out of a mangled twin A single -O sets both path_html and path_log (htscoremain.c:411), so `httrack -O café url` sends the logs through path_log. Since argv is UTF-8, path_log holds UTF-8 bytes, but the two-file log branch created its directory and opened hts-log.txt/hts-err.txt with the ANSI structcheck()/fopen(), which on Windows read those bytes as the codepage and dropped the logs into a second, mangled caf<mojibake>/ directory next to the mirror. #628 fixed the same class for the mirror root; this routes the log block through structcheck_utf8()/FOPEN() /UNLINK()/fexist_utf8() so the logs land under café/ with the mirror. On a UTF-8 filesystem the wrappers are the same calls, so only Windows changes. The cache half of #630 (hts-cache still opened ANSI, via minizip's own fopen and an ANSI opendir) is a larger, separate conversion and is left for a follow-up. A local-crawl test mirrors into a single non-ASCII -O and asserts the audits read hts-log.txt from that directory; it bites on the Windows CI leg where the encoding differs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Resolve tests/Makefile.am: keep 66_engine-port80-strip (#632) alongside this branch's test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A single
-Osets bothpath_htmlandpath_log, sohttrack -O café urlsends the logs throughpath_logtoo. argv is UTF-8, sopath_logholds UTF-8 bytes, but the two-file log branch inhts_main_internal()still created its directory and openedhts-log.txt/hts-err.txtthrough the ANSIstructcheck()/fopen(). On Windows those read the bytes as the codepage and dropped the logs into a second, mangledcaf<mojibake>/directory beside the mirror. This routes that branch through the same UTF-8 wrappers #628 used for the mirror root (structcheck_utf8/FOPEN/UNLINK/fexist_utf8), so the logs land undercafé/with the mirror. On a UTF-8 filesystem the wrappers resolve to the same calls, so only Windows changes.This is the log half of #630. I left the cache half out on purpose: relocating
hts-cacheis a much larger, coupled change, because the cache is written through minizip's own ANSIfopenand cleaned up through an ANSIopendir, so half-converting it would split or break the cache rather than move it. That wants its own PR, and #630 should stay open for it.Test 69 mirrors into a single non-ASCII
-Oand asserts the audits readhts-log.txtfrom that directory. Like test 64 it only bites on the Windows CI leg, where the two encodings differ; on Linux the change is a no-op and the whole suite stays green.