Skip to content

Commit

Permalink
Fix compile issue caused by token to path mapping
Browse files Browse the repository at this point in the history
Co-authored-by: witchymary <[email protected]>
  • Loading branch information
WhiredPlanck and witchymary committed Jan 4, 2025
1 parent 007cc4a commit fa912a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions libaegisub/common/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ constexpr std::string_view tokens[] = {
int find_token(std::string_view str) {
if (str.size() < 5 || str[0] != '?') return -1;
int idx;
switch (str[1] + str[4]) {
case 'a' + 'i': idx = 0; break;
case 'd' + 'a': idx = 1; break;
case 'd' + 't': idx = 2; break;
case 'l' + 'a': idx = 3; break;
case 's' + 'i': idx = 4; break;
case 't' + 'p': idx = 5; break;
case 'u' + 'r': idx = 6; break;
case 'v' + 'e': idx = 7; break;
case 's' + 't': idx = 8; break;
switch (str[2] + str[4]) {
case 'u' + 'i': idx = 0; break;
case 'a' + 'a': idx = 1; break;
case 'i' + 't': idx = 2; break;
case 'o' + 'a': idx = 3; break;
case 'c' + 'i': idx = 4; break;
case 'e' + 'p': idx = 5; break;
case 's' + 'r': idx = 6; break;
case 'i' + 'e': idx = 7; break;
case 't' + 't': idx = 8; break;
default: return -1;
}
return str.starts_with(tokens[idx]) ? idx : -1;
Expand Down
2 changes: 1 addition & 1 deletion libaegisub/include/libaegisub/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace agi {
/// Class for handling everything path-related in Aegisub
class Path {
/// Token -> Path map
std::array<fs::path, 8> paths;
std::array<fs::path, 9> paths;

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

0 comments on commit fa912a0

Please sign in to comment.