Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!cbmvax!carolyn From: carolyn@cbmvax.UUCP Newsgroups: comp.sys.amiga Subject: Cmd Corrections Message-ID: <1986@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 8-Jun-87 16:23:05 EDT Article-I.D.: cbmvax.1986 Posted: Mon Jun 8 16:23:05 1987 Date-Received: Wed, 10-Jun-87 07:26:28 EDT Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Distribution: comp Organization: Commodore Technology, West Chester, PA Lines: 68 Changes to Cmd.c for v2 ======================= It was brought to my attention that my Cmd program hung when used with Textcraft (symptom = wrote file to disk forever). This made me realize that I had forgotten to change CMD_WRITE requests with a length of -1 (write data until a NULL is encountered). Many devices understand a -1 length write, but AmigaDOS does not. I modified MyBeginIO() to replace any -1 write length with the actual length, and also to skip any 0 length writes. In addition, I discovered a very dumb typo in my u1[] usage string. Here are the corrections to the source. I will attempt to send new complete source and executable postings to doc. [] (correct this string defined above main) char u1[]={"\nCLI Usage: [run] Cmd [-s] [-m] [-n] devicename filename\n"}; [] (new MyBeginIO - changes are before and after if((!Skip)...) VOID MyBeginIO(ior) struct IOStdReq *ior; { reqcnt += 1; if(ior->io_Command == CMD_WRITE) { if(!writecnt) { while(MainBusy); MainBusy = TRUE; Signal(mainTask,OPEN_SIG); while(MainBusy); } /* If device CMD_WRITE uses length -1, convert to actual length */ if(ior->io_Length==-1) ior->io_Length = strlen(ior->io_Data); if((!Skip)||(writecnt>0)||(ior->io_Length > SHORT_WRITE)) { if(ior->io_Length) { while(MainBusy); MainBusy = TRUE; ioR = ior; Signal(mainTask,WRITE_SIG); /* Signal write */ while(MainBusy); } } writecnt += 1; ior->io_Actual = ior->io_Length; } if(!(ior->io_Flags & IOF_QUICK)) ReplyMsg(ior); } [] -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=