mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
580 stars 86 forks source link

A hash sign in a property value results in incorrect .davmail.properties being saved #326

Open hategan opened 10 months ago

hategan commented 10 months ago

The following line in .davmail.properties causes problems:

davmail.trayBackgroundColor=#c49fe2

Whenever Settings.save() is invoked, the value gets duplicated (e.g., davmail.trayBackgroundColor=#c49fe2#c49fe2). This appears to be caused by Settings.convertLine(), which considers hash signs in property values to introduce a comment. However, according to https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertiesfileformat01.html, comments are only introduced by a hash sign in the beginning of a line.

mguessan commented 10 months ago

Correct, implementation was wrong and did not allow hash in comments. Fix available in trunk