TwP / inifile

Native Ruby package for reading and writing INI files
http://codeforpeople.rubyforge.org/inifile
95 stars 47 forks source link

backslashes are not properly parsed #36

Open Mazwak opened 9 years ago

Mazwak commented 9 years ago

Hi

I am using this gem to parse a file with backslashes, windows path, and it does not work.

I see you escape and unescape at various point, but I don't get why. I nooped both methods, and everything works as I expect.

As you parse line by line, there will most likely never be any \n and \r. It would be very strange to find an \0, and it can be dismissed if found. There's no reason to escape \t and .

What do you think of just getting rid of those two methods ?

Mazwak commented 9 years ago

I just noticed in the Readme why you are escaping backslashes. Unfortunately, the claim that you can disable it is false.

And I still think it is a bad idea to allow escape sequences in an ini-file.

Btw, here is what I'm trying to parse :

TMP=C:\temp

and I get

C:<tab>emp

from it.