Commit 49095e5
committed
path_utils: new mp_stripext shorthand
This functionality has at least two users, screenshot template expansion
of %F and the filename/no-ext property getter. Generalize what the
latter does, so it can be reused by the former, which currently relies
on a private stripext function.
Also the check in mp_splitext, if there is a leading dot in the path
did not work on paths that were not basenames already. It would've also
split a partial path, in case there were more than one. And the check
for / in the split portion, was ignoring the possibility of windows
paths which use \ as separator.
Thus only work with the basename of the provided path.1 parent b89f7c7 commit 49095e5
2 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
104 | 116 | | |
105 | 117 | | |
106 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
0 commit comments