"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/iso_manip.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.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.

iso_manip.c  (xorriso-1.5.2):iso_manip.c  (xorriso-1.5.4)
skipping to change at line 282 skipping to change at line 282
xorriso->pacifier_byte_count+= iso_file_get_size((IsoFile *) *node); xorriso->pacifier_byte_count+= iso_file_get_size((IsoFile *) *node);
ret= 1; ret= 1;
} }
Xorriso_free_meM(trunc_name); Xorriso_free_meM(trunc_name);
return(ret); return(ret);
} }
/* /*
@param boss_iter Opaque handle to be forwarded to actions in ISO image @param boss_iter Opaque handle to be forwarded to actions in ISO image
Set to NULL if calling this function without having Set to NULL if calling this function without having
a boss iterator objetc. a boss iterator object.
@param node Pointer to pointer to existing node, @param node Pointer to pointer to existing node,
*node is set to NULL, if the node gets removed. *node is set to NULL, if the node gets removed.
@param flag bit0= source is directory @param flag bit0= source is directory
bit4= return 3 on rejection by exclusion or user bit4= return 3 on rejection by exclusion or user
bit6= do not delete eventually existing node from di_array bit6= do not delete eventually existing node from di_array
bit7= no special handling of split file directories bit7= no special handling of split file directories
@return 1= no action was needed, 2= target removed, @return 1= no action was needed, 2= target removed,
3= rejected with bit4, <=0 means error 3= rejected with bit4, <=0 means error
*/ */
int Xoriso_handle_collision(struct XorrisO *xorriso, void *boss_iter, int Xoriso_handle_collision(struct XorrisO *xorriso, void *boss_iter,
skipping to change at line 1616 skipping to change at line 1616
Text_shellsafe(eff_dest, xorriso->info_text, 1); Text_shellsafe(eff_dest, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
return(0); return(0);
} }
} }
return(1); return(1);
} }
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image /* @param boss_iter Opaque handle to be forwarded to actions in ISO image
Set to NULL if calling this function from outside ISO world Set to NULL if calling this function from outside ISO world
@param flag bit0= silently ignore attempt of renaming to same path
and return 2
*/ */
int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter, int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
char *origin, char *dest, int flag) char *origin, char *dest, int flag)
{ {
int ret, ol, dest_ret; int ret, ol, dest_ret;
char *eff_dest= NULL, *dir_adr= NULL, *cpt; char *eff_dest= NULL, *dir_adr= NULL, *cpt;
char *leafname, *eff_origin= NULL, *old_leafname; char *leafname, *eff_origin= NULL, *old_leafname;
IsoImage *volume; IsoImage *volume;
IsoDir *origin_dir, *dest_dir; IsoDir *origin_dir, *dest_dir;
IsoNode *node, *iso_node; IsoNode *node, *iso_node;
skipping to change at line 1666 skipping to change at line 1668
} }
/* Prevent that destination is a subordinate of origin /* Prevent that destination is a subordinate of origin
(that would be a black hole plopping out of the universe) */ (that would be a black hole plopping out of the universe) */
ol= strlen(eff_origin); ol= strlen(eff_origin);
if(ol==0) { if(ol==0) {
sprintf(xorriso->info_text, "May not rename root directory"); sprintf(xorriso->info_text, "May not rename root directory");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;} {ret= 0; goto ex;}
} else if(strcmp(eff_origin, eff_dest)==0) { } else if(strcmp(eff_origin, eff_dest)==0) {
if(flag & 1)
{ret= 2; goto ex;}
sprintf(xorriso->info_text, "Ignored attempt to rename "); sprintf(xorriso->info_text, "Ignored attempt to rename ");
Text_shellsafe(eff_origin, xorriso->info_text, 1); Text_shellsafe(eff_origin, xorriso->info_text, 1);
strcat(xorriso->info_text, " to itself"); strcat(xorriso->info_text, " to itself");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
{ret= 0; goto ex;} {ret= 0; goto ex;}
} else if(strncmp(eff_origin, eff_dest, ol)==0 && } else if(strncmp(eff_origin, eff_dest, ol)==0 &&
(eff_dest[ol]==0 || eff_dest[ol]=='/')) { (eff_dest[ol]==0 || eff_dest[ol]=='/')) {
sprintf(xorriso->info_text, "May not rename "); sprintf(xorriso->info_text, "May not rename ");
Text_shellsafe(eff_origin, xorriso->info_text, 1); Text_shellsafe(eff_origin, xorriso->info_text, 1);
strcat(xorriso->info_text, " to its own sub address "); strcat(xorriso->info_text, " to its own sub address ");
Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;} {ret= 0; goto ex;}
} }
/* Check whether destination exists and may be not overwriteable */ /* Check whether destination exists and may be not overwritable */
ret= Xorriso_overwrite_dest(xorriso, boss_iter, ret= Xorriso_overwrite_dest(xorriso, boss_iter,
eff_dest, dest_ret, "Renaming", 0); eff_dest, dest_ret, "Renaming", 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
/* Ensure existence of destination directory */ /* Ensure existence of destination directory */
strcpy(dir_adr, eff_dest); strcpy(dir_adr, eff_dest);
cpt= strrchr(dir_adr, '/'); cpt= strrchr(dir_adr, '/');
if(cpt==NULL) if(cpt==NULL)
cpt= dir_adr+strlen(dir_adr); cpt= dir_adr+strlen(dir_adr);
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added

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