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

This commit is contained in:
Reece Wilson 2024-09-24 20:41:44 +01:00 committed by Jamie Reece Wilson
parent 6f51e9261d
commit 8063600b4f
6 changed files with 23 additions and 22 deletions

View File

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

View File

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

View File

@ -225,7 +225,7 @@ namespace Aurora::IO::FS
} }
} }
AUKN_SYM AuUInt32 GetLogicalSectorSizeFromPath(const AuString &path) AUKN_SYM AuUInt32 GetLogicalSectorSizeFromPath(const AuROString &path)
{ {
// TODO: ioctl BLKSSZGET under linux or GetPhysicalSectorSizeFromPath(path) // TODO: ioctl BLKSSZGET under linux or GetPhysicalSectorSizeFromPath(path)

View File

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

View File

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

View File

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