Commit 2c5312d1 authored by Ben Avison's avatar Ben Avison
Browse files

No longer trashes filetype and user access bits when copying a directory over an image file

Detail:
  Was doing a cimple copy of the load/execution and attribute words from the
  source to the destination. However, for directories the filetype bits in the
  load address are always &FFD (data) and the user access bits are always 0
  (even though all directories actually have user read/write access). Now
  these bits are left alone when updating an image file from a directory.
Admin:
  Tested on a Raspberry Pi, doing a partial update of !Boot.Loader image file.

Version 0.57. Tagged as 'FilerAct-0_57'
parent ab7c1494
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.56"
Module_Version SETA 56
Module_MajorVersion SETS "0.57"
Module_Version SETA 57
Module_MinorVersion SETS ""
Module_Date SETS "13 Jul 2012"
Module_ApplicationDate SETS "13-Jul-12"
Module_Date SETS "15 Jul 2012"
Module_ApplicationDate SETS "15-Jul-12"
Module_ComponentName SETS "FilerAct"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct"
Module_FullVersion SETS "0.56"
Module_HelpVersion SETS "0.56 (13 Jul 2012)"
Module_FullVersion SETS "0.57"
Module_HelpVersion SETS "0.57 (15 Jul 2012)"
END
/* (0.56)
/* (0.57)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.56
#define Module_MajorVersion_CMHG 0.57
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Jul 2012
#define Module_Date_CMHG 15 Jul 2012
#define Module_MajorVersion "0.56"
#define Module_Version 56
#define Module_MajorVersion "0.57"
#define Module_Version 57
#define Module_MinorVersion ""
#define Module_Date "13 Jul 2012"
#define Module_Date "15 Jul 2012"
#define Module_ApplicationDate "13-Jul-12"
#define Module_ApplicationDate "15-Jul-12"
#define Module_ComponentName "FilerAct"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct"
#define Module_FullVersion "0.56"
#define Module_HelpVersion "0.56 (13 Jul 2012)"
#define Module_LibraryVersionInfo "0:56"
#define Module_FullVersion "0.57"
#define Module_HelpVersion "0.57 (15 Jul 2012)"
#define Module_LibraryVersionInfo "0:57"
......@@ -384,10 +384,27 @@ static os_error *create_directory( char *dirname )
return os_file( &fileplace );
}
static os_error *write_catalogue_information( char *filename, int reload, int execute, int attributes )
static os_error *write_catalogue_information( char *filename, int objecttype, int reload, int execute, int attributes )
{
os_filestr fileplace;
if (objecttype & object_directory)
{
/* Check if we're copying an image file's information from a directory or vice versa */
fileplace.action = OSFile_ReadNoPath;
fileplace.name = filename;
os_error *err = os_file( &fileplace );
if ( err != NULL )
return err;
if ( fileplace.action != objecttype )
{
/* Leave the filetype and user read/write bits alone */
reload = (reload &~ 0xFFF00) | (fileplace.loadaddr & 0xFFF00);
attributes = (attributes &~ 3) | (fileplace.end & 3);
}
}
fileplace.action = OSFile_WriteInfo;
fileplace.name = filename;
fileplace.loadaddr = reload;
......@@ -1536,6 +1553,7 @@ static os_error *int_write_a_block( BOOL *i_am_empty, BOOL *that_finished_a_file
*/
err = write_catalogue_information(
fh->destination_filename,
fh->objecttype,
fh->reload,
fh->execute,
fh->attributes );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment