Author: carnold
Date: Tue Jun 17 22:24:16 2008
New Revision: 669087

URL: http://svn.apache.org/viewvc?rev=669087&view=rev
Log:
LOGCXX-292: Value continuation does not properly handle CRLF in property files

Modified:
    logging/log4cxx/trunk/src/changes/changes.xml
    logging/log4cxx/trunk/src/main/cpp/properties.cpp
    logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp
    logging/log4cxx/trunk/src/test/resources/input/propertiestestcase.properties

Modified: logging/log4cxx/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/changes/changes.xml?rev=669087&r1=669086&r2=669087&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/changes/changes.xml (original)
+++ logging/log4cxx/trunk/src/changes/changes.xml Tue Jun 17 22:24:16 2008
@@ -41,7 +41,8 @@
 <action issue="LOGCXX-285">LevelRangeFilter has default value for 
acceptOnMatch that is different from log4j</action>
 <action issue="LOGCXX-286">gcc 4.3 requires #include &lt;cstring&gt; when 
using memcpy and related.</action> 
 <action issue="LOGCXX-288">Unnecessary trailing semi-colons after LOG4CXX_INFO 
et al in docs, examples and tests.<action>
-<action issue="LOGCXX-291">Tab characters are not recognized in properties 
files.<action>
+<action issue="LOGCXX-291">Tab characters are not recognized in property 
files.<action>
+<action issue="LOGCXX-292">Value continuation does not properly handle CRLF in 
property files.<action>
 </release>
 <release version="0.10.0" date="2008-04-03" description="First Apache release">
 <action issue="LOGCXX-2">logger.h includes config.h</action>

Modified: logging/log4cxx/trunk/src/main/cpp/properties.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/properties.cpp?rev=669087&r1=669086&r2=669087&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/properties.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/properties.cpp Tue Jun 17 22:24:16 2008
@@ -256,7 +256,7 @@
                         case ELEMENT_CONTINUE2:
                                 switch(c)
                                 {
-                                case 0x20: // '\n'
+                                case 0x0A: // '\n'
                                         if (!get(in, c))
                                                 finished = true;
                                         lexemType = ELEMENT_CONTINUE;

Modified: logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp?rev=669087&r1=669086&r2=669087&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp Tue Jun 
17 22:24:16 2008
@@ -35,6 +35,7 @@
                 LOGUNIT_TEST(testTab5);
                 LOGUNIT_TEST(testTab6);
                 LOGUNIT_TEST(testTab7);
+                LOGUNIT_TEST(testCRLF1);
         LOGUNIT_TEST_SUITE_END();
 
 public:
@@ -137,6 +138,18 @@
           LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), 
actual);
         }
 
+        /**
+         *  Test tab in value continuation, see LOGCXX-291.
+        */
+        void testCRLF1() {
+          FileInputStreamPtr propFile(
+            new 
FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+          Properties properties;
+          properties.load(propFile);
+          LogString 
actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.crlf1")));
+          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), 
actual);
+        }
+
 };
 
 

Modified: 
logging/log4cxx/trunk/src/test/resources/input/propertiestestcase.properties
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/resources/input/propertiestestcase.properties?rev=669087&r1=669086&r2=669087&view=diff
==============================================================================
--- 
logging/log4cxx/trunk/src/test/resources/input/propertiestestcase.properties 
(original)
+++ 
logging/log4cxx/trunk/src/test/resources/input/propertiestestcase.properties 
Tue Jun 17 22:24:16 2008
@@ -22,3 +22,5 @@
 propertiestestcase.tab6=\       in value
 propertiestestcase.tab7=continued\
        value
+propertiestestcase.crlf1=continued\
+ value


Reply via email to