[banshee] [StreamTagger] Ignore '\0' chars in strings returned by TagLib# (bgo#599806)
- From: Alexander Kojevnikov <alexk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [StreamTagger] Ignore '\0' chars in strings returned by TagLib# (bgo#599806)
- Date: Fri, 6 Nov 2009 09:35:17 +0000 (UTC)
commit e237c6ca0b97c7be598a727459fc73a18a0aacb6
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date: Fri Nov 6 20:31:56 2009 +1100
[StreamTagger] Ignore '\0' chars in strings returned by TagLib# (bgo#599806)
.../Banshee.Core/Banshee.Streaming/StreamTagger.cs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs b/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
index 0b0d22e..17fd40d 100644
--- a/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
+++ b/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
@@ -67,8 +67,13 @@ namespace Banshee.Streaming
private static string Choose (string priority, string fallback, bool flip)
{
return flip
- ? String.IsNullOrEmpty (fallback) ? priority : fallback
- : String.IsNullOrEmpty (priority) ? fallback : priority;
+ ? IsNullOrEmpty (fallback) ? priority : fallback
+ : IsNullOrEmpty (priority) ? fallback : priority;
+ }
+
+ private static bool IsNullOrEmpty (string s)
+ {
+ return String.IsNullOrEmpty (s) || s.IndexOf ('\0') >= 0 && s.Trim ('\0').Length == 0;
}
#pragma warning disable 0169
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]