"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/compare_file.c" between
libisoburn-1.5.0.tar.gz and libisoburn-1.5.2.tar.gz

About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.

compare_file.c  (libisoburn-1.5.0):compare_file.c  (libisoburn-1.5.2)
skipping to change at line 103 skipping to change at line 103
/* @param flag bit0= compare atime /* @param flag bit0= compare atime
bit1= compare ctime bit1= compare ctime
*/ */
int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag) int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
{ {
struct stat s1, s2; struct stat s1, s2;
int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done; int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done;
char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40]; char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40];
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1; off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
double dcount;
ret= lstat(adr1, &s1); ret= lstat(adr1, &s1);
if(ret==-1) { if(ret==-1) {
printf("? %s : cannot lstat() : %s\n", adr1, strerror(errno)); printf("? %s : cannot lstat() : %s\n", adr1, strerror(errno));
return(0); return(0);
} }
strcpy(a, Ftypetxt(s1.st_mode, 1)); strcpy(a, Ftypetxt(s1.st_mode, 1));
strcat(a, " "); strcat(a, " ");
if(adrc[0]) { if(adrc[0]) {
if(strlen(a) + strlen(adrc) < 4096) if(strlen(a) + strlen(adrc) < 4096)
skipping to change at line 241 skipping to change at line 242
if(buf1[i]!=buf2[i]) { if(buf1[i]!=buf2[i]) {
if(first_diff<0) if(first_diff<0)
first_diff= i; first_diff= i;
diffcount++; diffcount++;
} }
} }
} }
if(diffcount>0 || r1count!=r2count) { if(diffcount>0 || r1count!=r2count) {
if(first_diff<0) if(first_diff<0)
first_diff= (r1count>r2count ? r2count : r1count); first_diff= (r1count>r2count ? r2count : r1count);
if(r1count > r2count)
dcount= diffcount + (r1count - r2count);
else
dcount= diffcount + (r2count - r1count);
printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a, printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a,
(s1.st_mtime==s2.st_mtime ? "CONTENT":"content"), (s1.st_mtime==s2.st_mtime ? "CONTENT":"content"),
(double) (diffcount + abs(r1count-r2count)), (double) first_diff); dcount, (double) first_diff);
differs= 1; differs= 1;
} }
} }
if(fd1!=-1) if(fd1!=-1)
close(fd1); close(fd1);
if(fd2!=-1) if(fd2!=-1)
close(fd2); close(fd2);
return(!differs); return(!differs);
} }
skipping to change at line 297 skipping to change at line 302
if(strlen(argv[1]) - strlen(argv[2]) > 4000) { if(strlen(argv[1]) - strlen(argv[2]) > 4000) {
fprintf(stderr, "common address part exceeds size limit of 4000\n"); fprintf(stderr, "common address part exceeds size limit of 4000\n");
exit(3); exit(3);
} }
if(strlen(argv[3]) + 1 + strlen(argv[1]) - strlen(argv[2]) >= 4096) { if(strlen(argv[3]) + 1 + strlen(argv[1]) - strlen(argv[2]) >= 4096) {
fprintf(stderr, "prefix2 exceeds size limit of 4095\n"); fprintf(stderr, "prefix2 exceeds size limit of 4095\n");
exit(3); exit(3);
} }
strcpy(adr1, argv[1]); strcpy(adr1, argv[1]);
strcpy(adrc, argv[1]+strlen(argv[2])); strcpy(adrc, argv[1]+strlen(argv[2]));
sprintf(adr2, "%s%s%s", strcpy(adr2, argv[3]);
argv[3], (adrc[0]=='/' || adrc[0]==0 ? "" : "/"), adrc); if(adrc[0] == '/' || adrc[0] == 0)
strcat(adr2, "/");
strcat(adr2, adrc);
ret= Compare_2_files(adr1, adr2, adrc, (with_ctime<<1)); ret= Compare_2_files(adr1, adr2, adrc, (with_ctime<<1));
exit(ret<=0); exit(ret<=0);
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 10 lines changed or added

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