Commit 65e5abb
committed
misc/path_utils: make mp_basename() return full URLs
When the path is a URL, use the whole path as basename. The dirname will
be "." in this case.
This simplifies various checks throughout the codebase. In particular,
it avoids returning an empty string for URLs ending with /.
The filename property will return full URLs, which is desirable because
the domain and path segments before the last are useful information.
This fixes half of #10975.
This also fixes the issue described in #17015 of %f in
--screenshot-template being evaluated to an empty string for URLs ending
with /, which can inadvertently make it use an absolute path.
Alternative to #16932 and #17021.1 parent bbafb74 commit 65e5abb
File tree
4 files changed
+18
-25
lines changed- misc
- player
- lua
4 files changed
+18
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3508 | 3508 | | |
3509 | 3509 | | |
3510 | 3510 | | |
3511 | | - | |
3512 | | - | |
3513 | | - | |
3514 | | - | |
3515 | | - | |
3516 | | - | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
3517 | 3514 | | |
3518 | 3515 | | |
3519 | 3516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
255 | 253 | | |
256 | 254 | | |
257 | 255 | | |
258 | | - | |
| 256 | + | |
259 | 257 | | |
260 | 258 | | |
261 | 259 | | |
| |||
287 | 285 | | |
288 | 286 | | |
289 | 287 | | |
290 | | - | |
| 288 | + | |
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
| |||
412 | 410 | | |
413 | 411 | | |
414 | 412 | | |
415 | | - | |
| 413 | + | |
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 52 | + | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
0 commit comments