Commit cc05c03
committed
Normalize drive letters when resolving paths on Windows
When it comes to resolving paths on Windows, even though the underlying
API expects drive letter prefixes to be uppercase, some sources (e.g.
environment variables like `=C:`) won't normalize components, instead
returning the value as-is. While this wouldn't be a problem normally as
NTFS is case-insensitive on Windows, this introduces duplicates in the
database when adding new entries via `zoxide add`:
```batchfile prompt
> zoxide query --list
D:\
d:\
D:\coding
d:\coding
D:\coding\.cloned
d:\coding\.cloned
```
This is a cherry-pick from ajeetdsouza#567; see also rust-lang/rust-analyzer#14683.
Signed-off-by: mataha <[email protected]>1 parent dbe6f18 commit cc05c03
2 files changed
+40
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
312 | 339 | | |
313 | 340 | | |
314 | 341 | | |
315 | | - | |
| 342 | + | |
316 | 343 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 344 | + | |
| 345 | + | |
320 | 346 | | |
321 | 347 | | |
322 | | - | |
323 | 348 | | |
| 349 | + | |
| 350 | + | |
324 | 351 | | |
325 | 352 | | |
326 | 353 | | |
327 | 354 | | |
328 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
329 | 359 | | |
330 | 360 | | |
331 | | - | |
332 | 361 | | |
333 | 362 | | |
334 | 363 | | |
| |||
0 commit comments