[banshee] [KeyValueParser] Quoted values (bgo#608917)



commit 8cb16d833a63c1ef29514d29cc7548db66774ec3
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Thu Feb 4 20:53:11 2010 +1100

    [KeyValueParser] Quoted values (bgo#608917)

 .../Banshee.Dap.MassStorage/KeyValueParser.cs      |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs
index 4646ad9..1acb629 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs
@@ -49,17 +49,20 @@ namespace Banshee.Dap.MassStorage
         private void Parse ()
         {
             bool in_value = false;
+            bool in_quotes = false;
             char c;
 
             while ((c = Read ()) != Char.MaxValue) {
-                if (!in_value && c == '=') {
+                if (c == '"') {
+                    in_quotes = !in_quotes;
+                } else if (!in_value && c == '=') {
                     key = Collect ();
                     if (!String.IsNullOrEmpty (key)) {
                         in_value = true;
                     } else {
                         key = null;
                     }
-                } else if (Char.IsWhiteSpace (c) || c == ',') {
+                } else if (!in_quotes && (Char.IsWhiteSpace (c) || c == ',')) {
                     if (!in_value) {
                         continue;
                     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]