Commit 7f7462d
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 #567; see also rust-lang/rust-analyzer#14683.
Signed-off-by: mataha <[email protected]>1 parent 2856310 commit 7f7462d
3 files changed
+53
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
| 294 | + | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
| 304 | + | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 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 | + | |
| 339 | + | |
| 340 | + | |
312 | 341 | | |
313 | 342 | | |
314 | 343 | | |
315 | | - | |
| 344 | + | |
316 | 345 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 346 | + | |
| 347 | + | |
320 | 348 | | |
321 | | - | |
322 | | - | |
| 349 | + | |
323 | 350 | | |
| 351 | + | |
| 352 | + | |
324 | 353 | | |
325 | 354 | | |
326 | 355 | | |
327 | 356 | | |
328 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
329 | 361 | | |
330 | 362 | | |
331 | | - | |
332 | 363 | | |
333 | 364 | | |
334 | 365 | | |
| |||
340 | 371 | | |
341 | 372 | | |
342 | 373 | | |
343 | | - | |
| 374 | + | |
344 | 375 | | |
345 | 376 | | |
346 | 377 | | |
| |||
0 commit comments