Skip to content

Commit 2bdbc77

Browse files
committed
elf2rel: Add single-line comment handling
1 parent 46e08c4 commit 2bdbc77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ttyd-tools/elf2rel/elf2rel.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ std::map<std::string, uint32_t> loadSymbolMap(const std::string &filename)
1717
std::ifstream inputStream(filename);
1818
for (std::string line; std::getline(inputStream, line); )
1919
{
20+
boost::trim_left(line);
21+
22+
// Ignore comments
23+
if (line.find_first_of("//") == line.npos)
24+
{
25+
continue;
26+
}
27+
2028
size_t index = line.find_first_of(':');
2129

2230
std::string name = line.substr(index + 1);

0 commit comments

Comments
 (0)