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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libid3tag/file.c b/libid3tag/file.c
index 5ad025b..9210571 100644
--- a/libid3tag/file.c
+++ b/libid3tag/file.c
@@ -704,8 +704,6 @@ int v2_write(struct id3_file *file,
if (!tmp)
return -1;
- rc = copy_block(file->iofile, tmp, 0, file->tags[0].location);
- if (rc == 0) {
if (data && length)
rc = fwrite(data, length, 1, tmp) != 1;
else
@@ -713,8 +711,10 @@ int v2_write(struct id3_file *file,
if (rc == 0)
rc = copy_block(file->iofile, tmp,
- file->tags[0].location + file->tags[0].length, -1);
- }
+ /* FIXME: Should I check tag->version instead? */
+ (file->tags[0].location == 0) ?
+ file->tags[0].length : 0, -1);
+
fclose(tmp);
if (rc)
unlink(tmpname);

Return to:

Send suggestions and report system problems to the System administrator.