Commit 78404c6b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Don't postmortem when merely run at the CLI

FontMerge is intended to be a Wimp task, but only installs a signal handler for SIGOSERROR after calling Wimp_Initialise. Therefore, when invoked from the command line the "Window Manager is in use" error ends up with the default signal handler in the CLib, which postmortems.
Install a simple non-wimp error handler.
Also, don't try to clone !Sprites23 when adding supplementary (numbered) !Fonts directories when dir is full, these haven't been provided since Ursula.
Version manually bumped to 0.03, since FontMerge is a sub component of Configure.

Version 1.92. Tagged as 'Configure-1_92'
parent 5e890b71
Name:Font merger
Help1:FontMerge 0.02 (28-Jul-94)
Help1:FontMerge 0.03 (15-Apr-17)
Help2:Syntax: %s <source> [<destination>]
E00:Font '%0' cannot be merged because it already exists
/* (1.91)
/* (1.92)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.91
#define Module_MajorVersion_CMHG 1.92
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Oct 2014
#define Module_Date_CMHG 27 Apr 2017
#define Module_MajorVersion "1.91"
#define Module_Version 191
#define Module_MajorVersion "1.92"
#define Module_Version 192
#define Module_MinorVersion ""
#define Module_Date "01 Oct 2014"
#define Module_Date "27 Apr 2017"
#define Module_ApplicationDate "01-Oct-14"
#define Module_ApplicationDate "27-Apr-17"
#define Module_ComponentName "Configure"
#define Module_ComponentPath "castle/RiscOS/Sources/SystemRes/Configure"
#define Module_FullVersion "1.91"
#define Module_HelpVersion "1.91 (01 Oct 2014)"
#define Module_LibraryVersionInfo "1:91"
#define Module_FullVersion "1.92"
#define Module_HelpVersion "1.92 (27 Apr 2017)"
#define Module_LibraryVersionInfo "1:92"
......@@ -13,9 +13,9 @@
* limitations under the License.
*/
/*
* fonts.c
* fontmerge.c
*
* This is the module that handles the Fonts window.
* This is the module that merges fonts into !Fonts.
*
*/
......@@ -28,7 +28,6 @@
#include "swis.h"
/*#define FONTSDEBUG*/
/*#define FONTSTEST*/
#define MESSAGEFILE "FontMerge:Messages"
......@@ -1021,13 +1020,11 @@ printf( "itemstoskip = %d, itemsprocessed = %d\n", itemstoskip, itemsprocessed )
err = mkdir( tbuf );
if ( !err ) err = copy_file( tbuf, currentdest, "!Boot" );
if ( !err ) err = copy_file( tbuf, currentdest, "!Run" );
if ( !err ) err = copy_file( tbuf, currentdest, "!Help" );
if ( !err ) err = copy_file( tbuf, currentdest, "!Sprites" );
if ( !err ) err = adjust_sprite_number( tbuf, "!Sprites", base_number );
if ( !err ) err = copy_file( tbuf, currentdest, "!Sprites22" );
if ( !err ) err = adjust_sprite_number( tbuf, "!Sprites22", base_number );
if ( !err ) err = copy_file( tbuf, currentdest, "!Sprites23" );
if ( !err ) err = adjust_sprite_number( tbuf, "!Sprites23", base_number );
if ( !err ) err = copy_file( tbuf, currentdest, "!Help" );
if ( err ) _swi( OS_GenerateError, _IN(0), err );
strcpy( currentdest, tbuf );
......@@ -1133,6 +1130,13 @@ static void errhandler(int signal)
signal=signal;
}
static void errhandler_nonwimp(int signal)
{
fprintf( stderr, "%s\n", _kernel_last_oserror()->errmess );
exit(1);
signal=signal;
}
/*
Syntax:
FontMerge <source> [<destination>]
......@@ -1143,11 +1147,7 @@ int main( int argc, char **argv )
char *destination;
int msgs[1];
#ifdef FONTSTEST
adjust_sprite_number( "@","TSprites",12);
return 0;
#endif
signal(SIGOSERROR, &errhandler_nonwimp);
open_messages_file();
if ( argc < 2 || argc > 3 )
......
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