Bug 145532 - Empty xiph comments not removed as documented
Summary: Empty xiph comments not removed as documented
Status: RESOLVED FIXED
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Other
: NOR normal
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-17 02:33 UTC by Stephen F. Booth
Modified: 2007-06-08 13:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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);
 }