X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=aft.c;h=d843692934df671684d383ba4ec59996659ef75e;hb=25f41ad9243f73f2027c69c8dac9be39cdb506bb;hp=6481f3e4d6b031351b4b4ae09c410b3c4c0fc771;hpb=db0e72763ac5660b01c8c2db75901f4efa2c44cc;p=paraslash.git diff --git a/aft.c b/aft.c index 6481f3e4..d8436929 100644 --- a/aft.c +++ b/aft.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Andre Noll + * Copyright (C) 2007-2008 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -660,6 +660,7 @@ int open_and_update_audio_file(struct osl_row *aft_row, long score, AFTCOL_CHUNKS, &chunk_table_obj); if (ret < 0) return ret; + afd->afhi.chunk_table = NULL; ret = mmap_full_file(path, O_RDONLY, &map.data, &map.size, &afd->fd); if (ret < 0) @@ -697,10 +698,8 @@ int open_and_update_audio_file(struct osl_row *aft_row, long score, aced.old_afsi = &old_afsi; afs_event(AFSI_CHANGE, NULL, &aced); ret = save_afd(afd); - free(afd->afhi.chunk_table); - if (ret < 0) - goto err; err: + free(afd->afhi.chunk_table); osl_close_disk_object(&chunk_table_obj); return ret; } @@ -886,13 +885,15 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, lyrics_lines = make_lyrics_lines(afsi); image_lines = make_image_lines(afsi); filename_lines = make_filename_lines(d->path, opts->flags); - if (opts->mode == LS_MODE_MBOX) + if (opts->mode == LS_MODE_MBOX) { + const char *bn = para_basename(d->path); para_printf(b, "From foo@localhost %s\n" "Received: from\nTo: bar\nFrom: a\n" "Subject: %s\n\n", last_played_time, - d->path); + bn? bn : "?"); + } para_printf(b, "%s" /* filename stuff */ "%s%s%s%s" /* score */