[banshee] KeyValueParser: Make sure to collect final value in .is_audio_player
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] KeyValueParser: Make sure to collect final value in .is_audio_player
- Date: Wed, 17 Aug 2011 20:29:24 +0000 (UTC)
commit 729ec55169f08103ab085ec35fd8fcc96587059e
Author: William Witt <william witt-family net>
Date: Wed Aug 10 21:33:03 2011 -0500
KeyValueParser: Make sure to collect final value in .is_audio_player
The last value in the last line of the .is_audio_player was dropped
if the line didn't end with '\n'. Fix bgo#656176 by making sure we
collect it.
Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>
.../Banshee.Dap.MassStorage/KeyValueParser.cs | 8 +++++++-
1 files changed, 7 insertions(+), 1 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 1acb629..ccaecc4 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/KeyValueParser.cs
@@ -51,6 +51,7 @@ namespace Banshee.Dap.MassStorage
bool in_value = false;
bool in_quotes = false;
char c;
+ string value;
while ((c = Read ()) != Char.MaxValue) {
if (c == '"') {
@@ -67,7 +68,7 @@ namespace Banshee.Dap.MassStorage
continue;
}
- string value = Collect ();
+ value = Collect ();
if (!String.IsNullOrEmpty (value)) {
values.Add (value);
}
@@ -87,6 +88,11 @@ namespace Banshee.Dap.MassStorage
}
}
+ value = Collect ();
+ if (!String.IsNullOrEmpty (value)) {
+ values.Add (value);
+ }
+
Commit ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]