Canonicalize a Windows drive letter to upper-case in place: "c:/x" -> "C:/x". * Windows drive letters are case-insensitive, but a lowercase one (as agent * CWDs often report, e.g. Claude Code's "c:\...") otherwise produces a distinct * project key ("c-..." vs "C-...") and, on a case-insensitive FS, a colliding * cache file that clobbers the good index (#227/#367/#394). Folding to a single * c
| 67 | * Only the strict drive-root form `X:/` or bare `X:` is touched, so ordinary |
| 68 | * POSIX paths (which never start that way) are unaffected. */ |
| 69 | static void cbm_canonicalize_drive(char *path) { |
| 70 | if (path && path[0] >= 'a' && path[0] <= 'z' && path[1] == ':' && |
| 71 | (path[2] == '/' || path[2] == '\0')) { |
| 72 | path[0] = (char)(path[0] - 'a' + 'A'); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | #ifdef _WIN32 |
| 77 |
no outgoing calls
no test coverage detected