larsks / iniparse

Automatically exported from code.google.com/p/iniparse
Other
0 stars 0 forks source link

Trailing whitespace is significant for inline comments #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To find comments at the end of values, for example:
  [sec]
  opt = 7  ;comment

ConfigParser looks for a semicolon, and then does the following check:
  if pos != -1 and optval[pos-1].isspace():

That means that if pos == 0 - i.e., the value after '=' begins with a
semicolon, it is a comment only if the _last_ character on the line is a
whitespace character.

INIParse does not behave the same way at the moment.

Original issue reported on code.google.com by psobe...@gmail.com on 2 Mar 2009 at 4:43

GoogleCodeExporter commented 9 years ago

Original comment by psobe...@gmail.com on 2 Mar 2009 at 5:08

GoogleCodeExporter commented 9 years ago
This makes the fuzz test fail on iteration 465

Original comment by psobe...@gmail.com on 2 Mar 2009 at 5:09