aboutsummaryrefslogtreecommitdiff
path: root/libid3tag
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-17 11:59:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-03-17 11:59:19 +0200
commite25a44d9bdc40ca8bf2efcd12ed73e2104fdb360 (patch)
treeb805996c317f299b5421d6f48c9528664da00981 /libid3tag
parenta0a067bde62b828a09f165524dc993580ac7e450 (diff)
downloadidest-e25a44d9bdc40ca8bf2efcd12ed73e2104fdb360.tar.gz
idest-e25a44d9bdc40ca8bf2efcd12ed73e2104fdb360.tar.bz2
Improve scripting, implement v1->v2 conversion, implement --delete command.
* libid3tag/file.c (v2_write): Change for make it possible to convert v1 to v2. * src/.gitignore: Add guile.x. * src/Makefile.am (idest_SOURCES): Add guile.x (BUILT_SOURCES): Add guile.x (SUFFIXES): Add .x (.c.x): New rule * src/cmdline.opt: New option: --trace. * src/guile.c: Rewrite. * src/idest.h (MODE_QUERY, MODE_MOD, MODE_DELETE): New defines (from main.c). (guile_transform, guile_list): New protos. (guile_apply): Remove. * src/idop.c (set_tags): Handle convert_version == 2. (del_tags): New function. * src/main.c (del_id3): Call del_tags
Diffstat (limited to 'libid3tag')
-rw-r--r--libid3tag/file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libid3tag/file.c b/libid3tag/file.c
index 5ad025b..9210571 100644
--- a/libid3tag/file.c
+++ b/libid3tag/file.c
@@ -704,17 +704,17 @@ int v2_write(struct id3_file *file,
704 if (!tmp) 704 if (!tmp)
705 return -1; 705 return -1;
706 706
707 rc = copy_block(file->iofile, tmp, 0, file->tags[0].location); 707 if (data && length)
708 if (rc == 0) { 708 rc = fwrite(data, length, 1, tmp) != 1;
709 if (data && length) 709 else
710 rc = fwrite(data, length, 1, tmp) != 1; 710 rc = 0;
711 else
712 rc = 0;
713 711
714 if (rc == 0) 712 if (rc == 0)
715 rc = copy_block(file->iofile, tmp, 713 rc = copy_block(file->iofile, tmp,
716 file->tags[0].location + file->tags[0].length, -1); 714 /* FIXME: Should I check tag->version instead? */
717 } 715 (file->tags[0].location == 0) ?
716 file->tags[0].length : 0, -1);
717
718 fclose(tmp); 718 fclose(tmp);
719 if (rc) 719 if (rc)
720 unlink(tmpname); 720 unlink(tmpname);

Return to:

Send suggestions and report system problems to the System administrator.