[*] Amend: 7046ccec11 (Linux build regressions)

This commit is contained in:
Reece Wilson 2024-09-24 20:41:44 +01:00
parent 6f51e9261d
commit d34e5733d7
5 changed files with 22 additions and 21 deletions

View File

@ -276,13 +276,14 @@ namespace Aurora::IO::FS
int doubleSlash = 0;
char prevC = '\0';
//for (auto &character : str)
for (auto itr = str.begin();
itr != str.end();
)
itr++)
{
auto &character = *itr;
auto holding = *itr;
auto character = holding;
if ((character == '\\') || (character == '/'))
{
@ -292,25 +293,24 @@ namespace Aurora::IO::FS
if (character == '\\' &&
prevC == '\\')
{
*(itr - 1) = '\\';
itr = str.erase(itr);
doubleSlash--;
continue;
}
else
{
itr++;
*itr = kPathSplitter;
doubleSlash++;
}
character = kPathSplitter;
#else
itr++;
character = kPathSplitter;
*itr = kPathSplitter;
doubleSlash++;
#endif
}
else
{
itr++;
doubleSlash = 0;
}

View File

@ -34,7 +34,7 @@ namespace Aurora::IO::FS
AuString ret;
ret.resize(4096);
auto count = readlink(path.c_str(), ret.data(), ret.size());
auto count = readlink(AuString(path).c_str(), ret.data(), ret.size());
if (count <= 0)
{
return {};
@ -47,7 +47,7 @@ namespace Aurora::IO::FS
if (ret.size() && ret[0] != '/')
{
AuROString dir;
AuString path2 = path;
AuString path2(path);
path2 = AuReplaceAll(path2, "\\", "\\\\");
if (GoUpToSeparator(dir, path2))
{
@ -81,18 +81,19 @@ namespace Aurora::IO::FS
try
{
// TODO: use roxtl het lookup instead of allocating AuString
auto itr = gCachedStat.find(AuString(path));
AuString copy(path);
auto itr = gCachedStat.find(copy);
if (itr == gCachedStat.end())
{
int err = ::stat(path.c_str(), pstat);
int err = ::stat(copy.c_str(), pstat);
if (-1 == err)
{
gCachedStat[path] = {};
gCachedStat[copy] = {};
errno = 0;
}
else
{
gCachedStat[path] = *pstat;
gCachedStat[copy] = *pstat;
}
return err;
}
@ -135,7 +136,7 @@ namespace Aurora::IO::FS
return {};
}
auto dev = "/dev/" + path.substr(pos + 1);
auto dev = AuString("/dev/") + AuString(path.substr(pos + 1));
if (!BlockExists(dev))
{
return {};
@ -296,7 +297,7 @@ namespace Aurora::IO::FS
if (uCount == 2)
{
auto guess = "/sys/block/" + path.substr(5);
auto guess = AuString("/sys/block/") + AuString(path.substr(5));
if (AuFS::DirExists(guess))
{
return guess;
@ -313,7 +314,7 @@ namespace Aurora::IO::FS
AuStartsWith(path, "/sys/block/"))
{
// dunno. have fun
return path;
return AuString(path);
}
else
{

View File

@ -85,7 +85,7 @@ namespace Aurora::IO::FS
AuString tempPath;
if (Process::GetWorkingDirectory(tempPath))
{
tempPath += "/" + fileName;
tempPath += "/" + AuString(fileName);
if (FileExists(tempPath))
{
path = tempPath;

View File

@ -337,7 +337,7 @@ namespace Aurora::Process
return {};
}
#else
auto handle = dlopen(path.c_str(), RTLD_DEEPBIND);
auto handle = dlopen(AuString(path).c_str(), RTLD_DEEPBIND);
if (handle == nullptr)
{
SysPushErrorNested("Could't link dynamic library {}", path);
@ -674,8 +674,8 @@ namespace Aurora::Process
if (request.version.size())
{
au += "." + request.version;
base += "." + request.version;
au += AuString(".") + AuString(request.version);
base += AuString(".") + AuString(request.version);
}
if (ext && Build::kIsNtDerived)

View File

@ -138,7 +138,7 @@ namespace Aurora::Process
name = kSectionNameFile;
}
AuOptional<const AuString &> optProcessPath;
AuOptional<AuROString> optProcessPath;
if (AuCmdLine::gHackLoader.size())
{
optProcessPath = GetProcessFullPath();