]> granicus.if.org Git - taglib/commitdiff
xm: no \n too much in comment if there are no samples
authorMathias Panzenböck <grosser.meister.morti@gmx.net>
Sat, 18 Jun 2011 01:38:18 +0000 (03:38 +0200)
committerMathias Panzenböck <grosser.meister.morti@gmx.net>
Sat, 18 Jun 2011 01:38:18 +0000 (03:38 +0200)
taglib/xm/xmfile.cpp

index 5efc2204e01a28903f446e18b250d0102075e994..44fbe5abb6d4e75e5affdc2deab95705841a227a 100644 (file)
@@ -185,5 +185,11 @@ void XM::File::read(bool)
     seek(pos + instrumentSize + sampleHeaderSize * sampleCount + sumSampleLength);
   }
 
-  d->tag.setComment(intrumentNames.toString("\n") + "\n" + sampleNames.toString("\n"));
+  String comment(intrumentNames.toString("\n"));
+  if(sampleNames.size() > 0)
+  {
+    comment += "\n";
+    comment += sampleNames.toString("\n");
+  }
+  d->tag.setComment(comment);
 }