Hi,
in my program I use Asl file requester both through IASL->AslRequestTags and through getfile.gadget functions. I noticed that for some reason, both ways lead to crash if I give non-existing volume name to either ASLFR_InitialDrawer or entering such in the file requester Drawer field. If entering only non-existing drawer name (without volume name like Test:) causes fr to ask whether one should create a new drawer, as it should.
I extracted my Asl code to the file above. This code, however, doesn't crash but ask for reassignment as it should. I'm quite puzzled what's causing this. Would the GR log help to understand the problem. BTW, I don't have any global library bases stored in my program but using only the interfaces, would this affect asl.library?
I'm using AmigaOne X1000, OS41FE, the kernel.debug is effective.
Extracted code (which, runned separately, doesn't crash!)
and GR log through Sashimi (here, the SaveAsDoc() is the routine calling AslRequestTags. Note that requester starts properly. Crash comes when one enters the non-existing Test: volume name into Drawer field of requester.
Marko
#include <proto/asl.h> #include <proto/dos.h> #include <proto/exec.h> #include <libraries/asl.h> #include "string.h" /* ** compiled with: ** vc aslproblem.c -o ram:aslproblem +newlib */ struct AslIFace *IAsl; struct FileRequester *FileReq; struct Library *base; STRPTR Testname = "Test:testing"; int main(int ac,char *av[]) { STRPTR docname,dirname; int dirlen; if (base = IExec->OpenLibrary("asl.library",53L)) { if (IAsl = (struct AslIFace *)IExec->GetInterface(base,"main",1,NULL)) { FileReq = IAsl->AllocAslRequestTags(ASL_FileRequest, ASLFR_StayOnTop,TRUE, ASLFR_RejectIcons,TRUE, ASLFR_PrivateIDCMP,TRUE, ASLFR_SleepWindow,TRUE, ASLFR_DoPatterns,TRUE, TAG_DONE); dirlen = IDOS->FilePart(Testname) - Testname; if (dirname = IExec->AllocVecTags(dirlen+1,TAG_DONE)) { strncpy(dirname,Testname,dirlen); *(dirname+dirlen) = '\0'; /* note: strncpy doesn't put NUL if strlen(Testname) > dirlen! */ } if (FileReq) { IAsl->AslRequestTags(FileReq, ASLFR_TitleText,"Testing!", ASLFR_InitialDrawer,dirname, ASLFR_InitialFile,IDOS->FilePart(Testname), ASLFR_InitialPattern,"(#?.xml|#?.mxl)", ASLFR_DoSaveMode,TRUE, TAG_DONE); IAsl->FreeAslRequest(FileReq); } if (dirname) IExec->FreeVec(dirname); IExec->DropInterface((struct Interface *)IAsl); } IExec->CloseLibrary(base); } return(0); }
"DEVS:lpr.device" Hunk 0000 Offset 00000000 (SegList: 0x1658912d) ADDR: 6ffb8700 9126bc00 00000000 00000000 00000000 00000000 00000000 57cc1150 Page information: Page not found [_impl_AddTask] Adding Task 0x596241b0, Background CLI (0x5a6302a0) [_impl_AddTask] Task = 0x596241b0, ETask = 0xdfb47e50, Context = 0xdfb9e3e0 [_impl_AddTask] Stack bottom = 0x5e3e9038, Stack top = 0x5e3ed024, Stack pointer = 0x5e3ecff0 [_impl_AddTask] Task added to ready list