Subversion Repositories SvarDOS

Rev

Rev 571 | Rev 957 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 571 Rev 576
Line 200... Line 200...
200
  if (argvlist) argvlist[argc] = NULL;
200
  if (argvlist) argvlist[argc] = NULL;
201
  return(argc);
201
  return(argc);
202
}
202
}
203
 
203
 
204
 
204
 
205
enum cmd_result cmd_process(struct rmod_props far *rmod, unsigned short env_seg, const char *cmdline, void *BUFFER, unsigned short BUFFERSZ, const struct redir_data *redir) {
205
enum cmd_result cmd_process(struct rmod_props far *rmod, unsigned short env_seg, const char *cmdline, void *BUFFER, unsigned short BUFFERSZ, const struct redir_data *redir, unsigned char delstdin) {
206
  const struct CMD_ID *cmdptr;
206
  const struct CMD_ID *cmdptr;
207
  unsigned short argoffset;
207
  unsigned short argoffset;
208
  enum cmd_result cmdres;
208
  enum cmd_result cmdres;
209
  struct cmd_funcparam *p = (void *)BUFFER;
209
  struct cmd_funcparam *p = (void *)BUFFER;
210
  p->BUFFERSZ = BUFFERSZ - sizeof(*p);
210
  p->BUFFERSZ = BUFFERSZ - sizeof(*p);
Line 256... Line 256...
256
  cmdres = (cmdptr->func_ptr)(p);
256
  cmdres = (cmdptr->func_ptr)(p);
257
 
257
 
258
  /* cancel redirections */
258
  /* cancel redirections */
259
  redir_revert();
259
  redir_revert();
260
 
260
 
-
 
261
  /* delete stdin temporary file */
-
 
262
  if (delstdin) {
-
 
263
    const char *fname = redir->stdinfile;
-
 
264
    unsigned short doserr = 0;
-
 
265
    _asm {
-
 
266
      push ax
-
 
267
      push dx
-
 
268
      mov ah, 0x41  /* delete a file */
-
 
269
      mov dx, fname /* DS:DX - filename to delete */
-
 
270
      int 0x21
-
 
271
      jnc DONE
-
 
272
      mov doserr, ax
-
 
273
      DONE:
-
 
274
      pop dx
-
 
275
      pop ax
-
 
276
    }
-
 
277
    if (doserr) {
-
 
278
      output(fname);
-
 
279
      output(": ");
-
 
280
      nls_outputnl_doserr(doserr);
-
 
281
    }
-
 
282
  }
-
 
283
 
261
  return(cmdres);
284
  return(cmdres);
262
}
285
}