mirror of
https://github.com/deadw00d/AROS.git
synced 2026-01-12 08:35:21 +00:00
Read and provide stack if icon is present.
The default stack is too low in many cases leading to crashes further on. This fixes https://github.com/deadwood2/AROS/issues/196
This commit is contained in:
8
external/openurl/library/init.c
vendored
8
external/openurl/library/init.c
vendored
@ -55,6 +55,7 @@ struct Library *RexxSysBase = NULL;
|
||||
struct RxsLib *RexxSysBase = NULL;
|
||||
#endif
|
||||
struct Library *IFFParseBase = NULL;
|
||||
struct Library *IconBase = NULL;
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
@ -72,6 +73,12 @@ freeBase(struct LibraryHeader *lib)
|
||||
lib->prefs = NULL;
|
||||
}
|
||||
|
||||
if(IconBase)
|
||||
{
|
||||
CloseLibrary(IconBase);
|
||||
IconBase = NULL;
|
||||
}
|
||||
|
||||
if(RexxSysBase)
|
||||
{
|
||||
DROPINTERFACE(IRexxSys);
|
||||
@ -148,6 +155,7 @@ initBase(struct LibraryHeader *lib)
|
||||
GETINTERFACE(IIFFParse, IFFParseBase))
|
||||
if((RexxSysBase = (APTR)OpenLibrary("rexxsyslib.library", 36)) &&
|
||||
GETINTERFACE(IRexxSys, RexxSysBase))
|
||||
if((IconBase = OpenLibrary("icon.library", 37)))
|
||||
{
|
||||
#if defined(__amigaos4__)
|
||||
lib->pool = AllocSysObjectTags(ASOT_MEMPOOL, ASOPOOL_MFlags, MEMF_SHARED|MEMF_CLEAR,
|
||||
|
||||
1
external/openurl/library/lib.h
vendored
1
external/openurl/library/lib.h
vendored
@ -27,6 +27,7 @@
|
||||
#include <proto/utility.h>
|
||||
#include <proto/iffparse.h>
|
||||
#include <proto/rexxsyslib.h>
|
||||
#include <proto/icon.h>
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
#include <dos/obsolete.h>
|
||||
|
||||
38
external/openurl/library/utils.c
vendored
38
external/openurl/library/utils.c
vendored
@ -23,6 +23,7 @@
|
||||
#include <proto/dos.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/utility.h>
|
||||
#include <proto/icon.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@ -294,6 +295,39 @@ static BOOL sendRexxMsg(STRPTR rxport, STRPTR rxcmd)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static LONG readNeededStack(STRPTR cmdtemplate)
|
||||
{
|
||||
LONG _ret = -1;
|
||||
TEXT c = '\0';
|
||||
STRPTR p = NULL;
|
||||
struct DiskObject *dobj = NULL;
|
||||
|
||||
if (!cmdtemplate)
|
||||
return _ret;
|
||||
|
||||
/* Command path will either be a first string without space or complete
|
||||
string*/
|
||||
p = strstr(cmdtemplate, " ");
|
||||
if (p != NULL)
|
||||
{
|
||||
c = *p;
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
dobj = GetDiskObject(cmdtemplate);
|
||||
if (dobj)
|
||||
{
|
||||
_ret = dobj->do_StackSize;
|
||||
FreeDiskObject(dobj);
|
||||
}
|
||||
|
||||
if (c != '\0') *p = c;
|
||||
|
||||
return _ret;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
BOOL sendToBrowser(STRPTR URL, struct List *portlist, ULONG flags, STRPTR pubScreenName)
|
||||
{
|
||||
BOOL res = FALSE;
|
||||
@ -363,6 +397,7 @@ BOOL sendToBrowser(STRPTR URL, struct List *portlist, ULONG flags, STRPTR pubScr
|
||||
TEXT c = '\0';
|
||||
BPTR lock;
|
||||
LONG error;
|
||||
LONG stack = -1;
|
||||
|
||||
if(isFlagSet(bn->ubn_Flags, UNF_DISABLED))
|
||||
continue;
|
||||
@ -389,6 +424,8 @@ BOOL sendToBrowser(STRPTR URL, struct List *portlist, ULONG flags, STRPTR pubScr
|
||||
|
||||
if (filePart) *filePart = c;
|
||||
|
||||
stack = readNeededStack(bn->ubn_Path);
|
||||
|
||||
/* start the browser */
|
||||
|
||||
error = SystemTags(cmd,SYS_Asynch, TRUE,
|
||||
@ -396,6 +433,7 @@ BOOL sendToBrowser(STRPTR URL, struct List *portlist, ULONG flags, STRPTR pubScr
|
||||
SYS_Output, NULL,
|
||||
SYS_Error, NULL,
|
||||
lock ? NP_CurrentDir : TAG_IGNORE, lock,
|
||||
stack != -1 ? NP_StackSize : TAG_IGNORE, stack,
|
||||
TAG_DONE);
|
||||
|
||||
freeArbitrateVecPooled(cmd);
|
||||
|
||||
Reference in New Issue
Block a user