Skip to content

Commit

Permalink
Merge branch 'master' into perProviderFixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paxcut authored Nov 17, 2024
2 parents 306d399 + 6d14b3f commit be7494e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ endfunction()
macro(configureCMake)
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")

# Enable C and C++ languages
enable_language(C CXX)

set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)

# Configure use of recommended build tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,16 @@ namespace hex::plugin::builtin {
if (!file.isValid())
return;

for (const auto &line : wolv::util::splitString(file.readString(), "\n")) {
// procfs files don't have a defined size, so we have to just keep reading until we stop getting data
std::string data;
while (true) {
auto chunk = file.readString(0xFFFF);
if (chunk.empty())
break;
data.append(chunk);
}

for (const auto &line : wolv::util::splitString(data, "\n")) {
const auto &split = splitString(line, " ");
if (split.size() < 5)
continue;
Expand All @@ -434,7 +443,7 @@ namespace hex::plugin::builtin {

std::string name;
if (split.size() > 5)
name = combineStrings(std::vector(split.begin() + 5, split.end()), " ");
name = wolv::util::trim(combineStrings(std::vector(split.begin() + 5, split.end()), " "));

m_memoryRegions.insert({ { start, end - start }, name });
}
Expand Down

0 comments on commit be7494e

Please sign in to comment.