"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/match.c" between
xorriso-1.4.6.tar.gz and xorriso-1.4.8.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

match.c  (xorriso-1.4.6):match.c  (xorriso-1.4.8)
skipping to change at line 620 skipping to change at line 620
(*filev)= (char **) calloc(count, sizeof(char *)); (*filev)= (char **) calloc(count, sizeof(char *));
if(*filev==NULL) { if(*filev==NULL) {
Xorriso_no_pattern_memory(xorriso, mem, 0); Xorriso_no_pattern_memory(xorriso, mem, 0);
return(-1); return(-1);
} }
return(1); return(1);
} }
/* @param flag bit0= a match count !=1 is a FAILURE event /* @param flag bit0= a match count !=1 is a FAILURE event
bit1= with bit0 tolerate 0 matches if pattern is a constant bit1= with bit0 tolerate 0 matches if pattern is a constant
bit3= do not add unresolved pattern to filev
*/ */
int Xorriso_expand_disk_pattern(struct XorrisO *xorriso, int Xorriso_expand_disk_pattern(struct XorrisO *xorriso,
int num_patterns, char **patterns, int extra_filec, int num_patterns, char **patterns, int extra_filec,
int *filec, char ***filev, off_t *mem, int flag) int *filec, char ***filev, off_t *mem, int flag)
{ {
int ret, count= 0, abs_adr= 0, i, was_count, was_filec; int ret, count= 0, abs_adr= 0, i, was_count, was_filec;
int nonconst_mismatches= 0, dive_count= 0; int nonconst_mismatches= 0, dive_count= 0;
char *dir_adr= NULL; char *dir_adr= NULL;
Xorriso_alloc_meM(dir_adr, char, SfileadrL); Xorriso_alloc_meM(dir_adr, char, SfileadrL);
*filec= 0; *filec= 0;
*filev= NULL; *filev= NULL;
xorriso->search_mode= 3; xorriso->search_mode= 3;
xorriso->structured_search= 1; xorriso->structured_search= 1;
for(i= 0; i<num_patterns; i++) { for(i= 0; i<num_patterns; i++) {
abs_adr= 0;
ret= Xorriso_prepare_expansion_pattern(xorriso, patterns[i], 4); ret= Xorriso_prepare_expansion_pattern(xorriso, patterns[i], 4);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(ret==2) if(ret==2)
abs_adr= 4; abs_adr= 4;
if(patterns[i][0]=='/' || abs_adr) { if(patterns[i][0]=='/' || abs_adr) {
strcpy(dir_adr, "/"); strcpy(dir_adr, "/");
abs_adr= 4; abs_adr= 4;
} else { } else {
skipping to change at line 668 skipping to change at line 669
ret= 0; goto ex; ret= 0; goto ex;
} }
} }
/* count the matches */ /* count the matches */
was_count= count; was_count= count;
ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, &count, NULL, 0, ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, &count, NULL, 0,
mem, &dive_count, 1 | abs_adr); mem, &dive_count, 1 | abs_adr);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(was_count==count && strcmp(patterns[i],"*")!=0 && (flag&3)!=1) { if(was_count==count && strcmp(patterns[i],"*")!=0 && (flag&3)!=1 &&
!(flag & 8)) {
count++; count++;
ret= Xorriso_eval_nonmatch(xorriso, patterns[i], ret= Xorriso_eval_nonmatch(xorriso, patterns[i],
&nonconst_mismatches, mem, 0); &nonconst_mismatches, mem, 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
} }
} }
ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches, ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches,
num_patterns, patterns, (flag&1)|2); num_patterns, patterns, (flag&1)|2);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
count+= extra_filec; count+= extra_filec;
(*mem)+= extra_filec * sizeof(char *); (*mem)+= extra_filec * sizeof(char *);
if(count<=0) if(count<=0)
{ret= 0; goto ex;} {ret= !(flag & 8); goto ex;}
ret= Xorriso_alloc_pattern_mem(xorriso, *mem, count, filev, 0); ret= Xorriso_alloc_pattern_mem(xorriso, *mem, count, filev, 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
/* now store addresses */ /* now store addresses */
for(i= 0; i<num_patterns; i++) { for(i= 0; i<num_patterns; i++) {
abs_adr= 0;
ret= Xorriso_prepare_expansion_pattern(xorriso, patterns[i], 4); ret= Xorriso_prepare_expansion_pattern(xorriso, patterns[i], 4);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(ret==2)
abs_adr= 4;
if(patterns[i][0]=='/' || abs_adr) { if(patterns[i][0]=='/' || abs_adr) {
strcpy(dir_adr, "/"); strcpy(dir_adr, "/");
abs_adr= 4; abs_adr= 4;
} else { } else {
strcpy(dir_adr, xorriso->wdx); strcpy(dir_adr, xorriso->wdx);
if(dir_adr[0]==0) if(dir_adr[0]==0)
strcpy(dir_adr, "/"); strcpy(dir_adr, "/");
} }
was_filec= *filec; was_filec= *filec;
ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, filec, *filev, ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, filec, *filev,
count, mem, &dive_count, abs_adr); count, mem, &dive_count, abs_adr);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(was_filec == *filec && strcmp(patterns[i],"*")!=0) { if(was_filec == *filec && strcmp(patterns[i],"*")!=0 && (flag & 3) != 1 &&
!(flag & 8)) {
(*filev)[*filec]= strdup(patterns[i]); (*filev)[*filec]= strdup(patterns[i]);
if((*filev)[*filec]==NULL) { if((*filev)[*filec]==NULL) {
(*mem)= strlen(patterns[i])+1; (*mem)= strlen(patterns[i])+1;
Xorriso_no_pattern_memory(xorriso, *mem, 0); Xorriso_no_pattern_memory(xorriso, *mem, 0);
ret= -1; goto ex; ret= -1; goto ex;
} }
(*filec)++; (*filec)++;
} }
} }
 End of changes. 7 change blocks. 
5 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)