Bug 145532

Summary: Empty xiph comments not removed as documented
Product: [Frameworks and Libraries] taglib Reporter: Stephen F. Booth <me>
Component: generalAssignee: Scott Wheeler <wheeler>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Other   
Latest Commit: Version Fixed In:

Description Stephen F. Booth 2007-05-17 02:33:45 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 4.0.1 (Apple Computer, Inc. build 5367) 
OS:                OS X

The documentation for Ogg::XiphComment::addField says "If the field value is empty, the field will be removed."  This is implemented incorrectly; this patch fixes the behavior to match the documentation.

Index: xiphcomment.cpp
===================================================================
--- xiphcomment.cpp     (revision 651409)
+++ xiphcomment.cpp     (working copy)
@@ -188,7 +188,7 @@
   if(replace)
     removeField(key.upper());
 
-  if(!key.isEmpty())
+  if(!value.isEmpty())
     d->fieldListMap[key.upper()].append(value);
 }
Comment 1 Scott Wheeler 2007-06-08 13:02:52 UTC
SVN commit 672863 by wheeler:

Remove empty Xiph comments.  Patch from Stephan Booth.

BUG:145532
CCMAIL:taglib-devel@kde.org


 M  +1 -1      xiphcomment.cpp  


--- trunk/kdesupport/taglib/taglib/ogg/xiphcomment.cpp #672862:672863
@@ -188,7 +188,7 @@
   if(replace)
     removeField(key.upper());
 
-  if(!key.isEmpty())
+  if(!key.isEmpty() && !value.isEmpty())
     d->fieldListMap[key.upper()].append(value);
 }