Skip to content

Commit fa912a0

Browse files
Fix compile issue caused by token to path mapping
Co-authored-by: witchymary <63314339+witchymary@users.noreply.github.com>
1 parent 007cc4a commit fa912a0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

libaegisub/common/path.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ constexpr std::string_view tokens[] = {
3636
int find_token(std::string_view str) {
3737
if (str.size() < 5 || str[0] != '?') return -1;
3838
int idx;
39-
switch (str[1] + str[4]) {
40-
case 'a' + 'i': idx = 0; break;
41-
case 'd' + 'a': idx = 1; break;
42-
case 'd' + 't': idx = 2; break;
43-
case 'l' + 'a': idx = 3; break;
44-
case 's' + 'i': idx = 4; break;
45-
case 't' + 'p': idx = 5; break;
46-
case 'u' + 'r': idx = 6; break;
47-
case 'v' + 'e': idx = 7; break;
48-
case 's' + 't': idx = 8; break;
39+
switch (str[2] + str[4]) {
40+
case 'u' + 'i': idx = 0; break;
41+
case 'a' + 'a': idx = 1; break;
42+
case 'i' + 't': idx = 2; break;
43+
case 'o' + 'a': idx = 3; break;
44+
case 'c' + 'i': idx = 4; break;
45+
case 'e' + 'p': idx = 5; break;
46+
case 's' + 'r': idx = 6; break;
47+
case 'i' + 'e': idx = 7; break;
48+
case 't' + 't': idx = 8; break;
4949
default: return -1;
5050
}
5151
return str.starts_with(tokens[idx]) ? idx : -1;

libaegisub/include/libaegisub/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace agi {
2222
/// Class for handling everything path-related in Aegisub
2323
class Path {
2424
/// Token -> Path map
25-
std::array<fs::path, 8> paths;
25+
std::array<fs::path, 9> paths;
2626

2727
/// Platform-specific code to fill in the default paths, called in the constructor
2828
void FillPlatformSpecificPaths();

0 commit comments

Comments
 (0)