New -find tests -has_filter, -has_no_filter

This commit is contained in:
2009-04-07 12:02:53 +00:00
parent 9217666566
commit f393aed6db
5 changed files with 55 additions and 4 deletions

View File

@ -6663,9 +6663,11 @@ int Xorriso_findi_test(struct XorrisO *xorriso, struct FindjoB *job,
int depth, int flag)
{
int ret, start_lba, end_lba, damage_filter, commit_filter, lba, a_filter;
int is_filtered= 0;
off_t damage_start, damage_end, size;
int lba_count, *file_end_lbas= NULL, *file_start_lbas= NULL, i;
void *wanted_node;
IsoStream *stream;
ret= Findjob_test(job, name, boss_stbuf, stbuf, depth, 1);
if(ret<=0)
@ -6749,6 +6751,20 @@ int Xorriso_findi_test(struct XorrisO *xorriso, struct FindjoB *job,
{ret= 0; goto ex;}
}
Findjob_get_filter_filter(job, &a_filter, 0);
if(a_filter) {
is_filtered= 0;
if(LIBISO_ISREG(node)) {
stream= iso_file_get_stream((IsoFile *) node);
if(iso_stream_get_input_stream(stream, 0) != NULL)
is_filtered= 1;;
}
if(a_filter < 0 && is_filtered)
{ret= 0; goto ex;}
if(a_filter > 0 && !is_filtered)
{ret= 0; goto ex;}
}
Findjob_get_wanted_node(job, &wanted_node, 0);
if(wanted_node != NULL && ((IsoNode *) wanted_node) != node)
{ret= 0; goto ex;}