File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -591,12 +591,11 @@ CDirectiveSymImport::CDirectiveSymImport(const fs::path& fileName)
591
591
{
592
592
// End line at comment (starting with ;)
593
593
// \x1A included here as well since No$gba .sym file ends with it
594
- size_t lineEnd = line.find_first_of (" ;\r\x1A " );
594
+ size_t lineEnd = line.length ();
595
+ lineEnd = std::min (line.find_first_of (" ;\r\x1A " ),lineEnd);
595
596
if (lineEnd != std::string::npos && lineEnd > 0 )
596
597
{
597
- lineEnd = line.find_last_not_of (" \t " ,lineEnd-1 );
598
- if (lineEnd != std::string::npos)
599
- lineEnd += 1 ;
598
+ lineEnd = std::max (line.find_last_not_of (" \t " ,lineEnd-1 )+1 ,(size_t )0 );
600
599
}
601
600
602
601
// Skip empty line
Original file line number Diff line number Diff line change 5
5
45544554 ValidLabelWithTabs
6
6
67766776 ValidLabelWithSpacesAndTabs
7
7
89988998 ValidLabelWithComment ; No$gba does allow this, if there is whitespace before the ;
8
-
8
+
9
9
11223344 @StaticLabel
10
10
55667788 @StaticLabel
11
11
99AABBCC @@LocalLabel
You can’t perform that action at this time.
0 commit comments