Commit 583a436
check-accessibility.sh: fix cache bugs
1. Unescaped regex in grep — the url_path was used directly as a grep
pattern (grep "^$url_path "). The 4 tutorial pages named [1.01]
Fundamentals..., [1.02] Introduction..., etc. have [ and ] in their
paths. Grep treats [1.01] as a character class matching 1, ., or 0,
so the pattern never matches the literal [. This caused:
- cache_hit to always return miss for those 4 pages
- cache_update's grep -v to never remove the old entry → duplicate
entries accumulated (hence 1666 entries for 1616 files)
2. cut -d' ' -f2 fails for paths with spaces — those same tutorial pages
have spaces in their names. When reading back the hash, cut -d' ' -f2
returned Fundamentals instead of the hash.
Fix: replaced grep + cut with awk using index($0, p)
(literal prefix match) and $NF (last field = hash).
Also cleaned up the duplicate entries in the cache.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0e2415e commit 583a436
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments