File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,8 @@ void Settings::setMisraRuleTexts(const std::string& data)
669669 std::string text = line.substr (pos + 1 );
670670 if (id.empty () || text.empty ())
671671 continue ;
672+ if (text[text.size () -1 ] == ' \r ' )
673+ text.erase (text.size () -1 );
672674 mMisraRuleTexts [id] = std::move (text);
673675 }
674676}
Original file line number Diff line number Diff line change @@ -263,9 +263,10 @@ class TestSettings : public TestFixture {
263263 void ruleTexts () const
264264 {
265265 Settings s;
266- s.setMisraRuleTexts (" 1.1 text 1\n 1.2 text 2\n " );
266+ s.setMisraRuleTexts (" 1.1 text 1\n 1.2 text 2\n 1.3 text 3 \r\ n" );
267267 ASSERT_EQUALS (" text 1" , s.getMisraRuleText (" misra-c2012-1.1" , " ---" ));
268268 ASSERT_EQUALS (" text 2" , s.getMisraRuleText (" misra-c2012-1.2" , " ---" ));
269+ ASSERT_EQUALS (" text 3" , s.getMisraRuleText (" misra-c2012-1.3" , " ---" ));
269270 }
270271
271272 void checkLevelDefault () const
You can’t perform that action at this time.
0 commit comments