libid3tag-0.15.1b-id3v1-zero-padding.patch 990 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/sh /usr/share/dpatch/dpatch-run
  2. ## 10_id3v1_zeropadding.dpatch by <sm17hs@gmail.com>
  3. ##
  4. ## All lines beginning with `## DP:' are a description of the patch.
  5. ## DP: Use zero padding instead of space padding for ID3V1 fields
  6. ## DP: (as requested by http://id3lib.sourceforge.net/id3/id3v1.html).
  7. @DPATCH@
  8. diff -urNad libid3tag-0.15.1b~/render.c libid3tag-0.15.1b/render.c
  9. --- libid3tag-0.15.1b~/render.c 2004-01-23 10:41:32.000000000 +0100
  10. +++ libid3tag-0.15.1b/render.c 2009-11-09 17:17:48.000000000 +0100
  11. @@ -183,18 +183,16 @@
  12. end = data + length;
  13. if (ucs4) {
  14. - while (*ucs4 && end - data > 0) {
  15. + while (*ucs4 && end - data > 0)
  16. *data++ = *ucs4++;
  17. -
  18. - if (data[-1] == '\n')
  19. - data[-1] = ' ';
  20. - }
  21. }
  22. - while (end - data > 0)
  23. - *data++ = ' ';
  24. -
  25. *data = 0;
  26. - return id3_latin1_serialize(ptr, padded, 0);
  27. + id3_latin1_serialize(ptr, padded, 0);
  28. +
  29. + if (end - data > 0)
  30. + id3_render_padding(ptr, 0, end - data);
  31. +
  32. + return length;
  33. }