magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

backslashes must be escaped on write #36

Closed apesternikov closed 4 years ago

apesternikov commented 5 years ago

according to https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertiesfileformat01.html The backslash character must be escaped as a double backslash

apesternikov commented 5 years ago

@magiconair could you please take a look? Thank you

magiconair commented 5 years ago

I'll have a look over the weekend. Want to make sure that the right tests are covered.

apesternikov commented 4 years ago

It was a year since the last response. Any progress in reviewing so far? Thank you

magiconair commented 4 years ago

This looks good to me. Will this break any existing code or break reading existing files?

magiconair commented 4 years ago

Sorry for the late response

apesternikov commented 4 years ago

This change would not break reading existing files since it only affects writing. Speaking of breaking existing code - it is entirely possible that code relying on this bug presence exists. I am not specifically aware of such code. According to https://pkg.go.dev/github.com/magiconair/properties?tab=importedby 223 opensource projects imports this package as of today, I am not sure how many of them are using the writing path. If you want to make sure no existing code is affected you can probably consider releasing v2?

apesternikov commented 4 years ago

ping?

magiconair commented 4 years ago

Lets do this.

apesternikov commented 4 years ago

thank you!