mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
disallow multiple input FLAC files when --import-tags-from=- is used (SF#1082577 http://sourceforge.net/tracker/index.php?func=detail&aid=1082577&group_id=13478&atid=113478)
This commit is contained in:
@@ -202,16 +202,27 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
|
||||
}
|
||||
}
|
||||
|
||||
/* check for only one FLAC file used with --import-cuesheet-from/--export-cuesheet-to */
|
||||
if(
|
||||
(
|
||||
0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM) ||
|
||||
0 != find_shorthand_operation(options, OP__EXPORT_CUESHEET_TO) ||
|
||||
0 != find_shorthand_operation(options, OP__EXPORT_PICTURE_TO)
|
||||
) && options->num_files > 1
|
||||
) {
|
||||
fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from', '--export-cuesheet-to' or '--export-picture-to'\n");
|
||||
had_error = true;
|
||||
/* check for only one FLAC file used with certain options */
|
||||
if(options->num_files > 1) {
|
||||
if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) {
|
||||
fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from'\n");
|
||||
had_error = true;
|
||||
}
|
||||
if(0 != find_shorthand_operation(options, OP__EXPORT_CUESHEET_TO)) {
|
||||
fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-cuesheet-to'\n");
|
||||
had_error = true;
|
||||
}
|
||||
if(0 != find_shorthand_operation(options, OP__EXPORT_PICTURE_TO)) {
|
||||
fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-picture-to'\n");
|
||||
had_error = true;
|
||||
}
|
||||
if(
|
||||
0 != find_shorthand_operation(options, OP__IMPORT_VC_FROM) &&
|
||||
0 == strcmp(find_shorthand_operation(options, OP__IMPORT_VC_FROM)->argument.filename.value, "-")
|
||||
) {
|
||||
fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-tags-from=-'\n");
|
||||
had_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(options->args.checks.has_block_type && options->args.checks.has_except_block_type) {
|
||||
|
||||
Reference in New Issue
Block a user