fixed SPF_InsertIncludesPass unpacking

This commit is contained in:
ALEXks
2025-04-30 09:14:22 +03:00
committed by Egor Mayorov
parent 15d8a8dd8f
commit 794e2daded
2 changed files with 7 additions and 6 deletions

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2412"
#define VERSION_SPF "2413"

View File

@@ -2207,15 +2207,16 @@ int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short
return -3;
filesToInclude.clear();
for (int i = 0; i < splited.size(); ++i)
unsigned i = 0;
while (i < splited.size())
{
string file = splited[i];
string file = splited[i++];
int num = 0;
if (sscanf(splited[i + 1].c_str(), "%d", &num) == -1)
if (sscanf(splited[i++].c_str(), "%d", &num) == -1)
return -4;
__spf_print(1, "file = %s:\n", file.c_str());
for (int k = i + 2; k < i + 2 + 2 * num; k += 2)
for (int k = i; k < i + 2 * num; k += 2)
{
int line = 0;
if (sscanf(splited[k].c_str(), "%d", &line) == -1)
@@ -2225,7 +2226,7 @@ int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short
filesToInclude[file].push_back(pair);
__spf_print(1, " include = [%d %s]\n", pair.first, pair.second.c_str());
}
i += 1 + num;
i += 2 * num;
}
return simpleTransformPass(INSERT_INCLUDES, options, projName, folderName, output, outputSize, outputMessage, outputMessageSize);
}