felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r1167322 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
Date Fri, 09 Sep 2011 18:18:57 GMT
Author: pauls
Date: Fri Sep  9 18:18:57 2011
New Revision: 1167322

URL: http://svn.apache.org/viewvc?rev=1167322&view=rev
Log:
Make the parsing more lenient.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java?rev=1167322&r1=1167321&r2=1167322&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
Fri Sep  9 18:18:57 2011
@@ -1537,7 +1537,6 @@ public class ManifestParser
     public static void main(String[] headers)
     {
         String header = headers[0];
-        
         if (header != null)
         {
             if (header.length() == 0)
@@ -1662,10 +1661,25 @@ public class ManifestParser
                     {
                         quoted = false;
                     }
-                    state = VALUE;
+                    if (!Character.isWhitespace(currentChar)) {
+                    	state = VALUE;
+                    }
+                    else {
+                    	currentPosition++;
+                    }
                     break;
                 case VALUE:
-                    escaped = currentChar == '\\';
+                    if (currentChar == '\\' ) 
+                    {
+                        if (escaped) 
+                        {
+                            escaped = false;
+                        }
+                        else 
+                        {
+                            escaped = true;
+                        }
+                    }
                     if (quoted && !escaped && currentChar == '\"') 
                     {
                         quoted = false;



Mime
View raw message