X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=38f47fd804c4d00594c58b8f9104538449f026f6;hp=77891342313e17295d5b60ea836fd9b187705ae9;hb=1709cc8f8a54429441f8f83c38146e667133c727;hpb=b52342d0b5df5446f149f0c1daf26f6e25b2aba7 diff --git a/aft.c b/aft.c index 77891342..38f47fd8 100644 --- a/aft.c +++ b/aft.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "para.h" #include "error.h" @@ -2044,6 +2045,22 @@ static int com_touch_callback(struct afs_callback_arg *aca) .data = aca, .action = touch_audio_file }; + if (cto->image_id >= 0) { + ret = img_get_name_by_id(cto->image_id, NULL); + if (ret < 0) { + para_printf(&aca->pbout, "invalid image ID: %d\n", + cto->image_id); + return ret; + } + } + if (cto->lyrics_id >= 0) { + ret = lyr_get_name_by_id(cto->lyrics_id, NULL); + if (ret < 0) { + para_printf(&aca->pbout, "invalid lyrics ID: %d\n", + cto->lyrics_id); + return ret; + } + } if (cto->flags & TOUCH_FLAG_FNM_PATHNAME) pmd.fnmatch_flags |= FNM_PATHNAME; ret = for_each_matching_row(&pmd);