Subversion Repositories SvarDOS

Rev

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

Rev 370 Rev 372
Line 244... Line 244...
244
  env_setvar(envseg, buff);
244
  env_setvar(envseg, buff);
245
}
245
}
246
 
246
 
247
 
247
 
248
int main(int argc, char **argv) {
248
int main(int argc, char **argv) {
249
  struct config cfg;
249
  static struct config cfg;
250
  unsigned short rmod_seg;
250
  static unsigned short rmod_seg;
251
  unsigned short far *rmod_envseg;
251
  static unsigned short far *rmod_envseg;
252
  unsigned short far *lastexitcode;
252
  static unsigned short far *lastexitcode;
-
 
253
  static unsigned char BUFFER[4096];
253
 
254
 
254
  parse_argv(&cfg, argc, argv);
255
  parse_argv(&cfg, argc, argv);
255
 
256
 
256
  rmod_seg = rmod_find();
257
  rmod_seg = rmod_find();
257
  if (rmod_seg == 0xffff) {
258
  if (rmod_seg == 0xffff) {
Line 287... Line 288...
287
      cmdline[(unsigned short)(cmdline[-1])] = '\r';
288
      cmdline[(unsigned short)(cmdline[-1])] = '\r';
288
    }
289
    }
289
 
290
 
290
    {
291
    {
291
      /* print shell prompt */
292
      /* print shell prompt */
292
      char buff[256];
-
 
293
      char *promptptr = buff;
293
      char *promptptr = BUFFER;
294
      buildprompt(promptptr, *rmod_envseg);
294
      buildprompt(promptptr, *rmod_envseg);
295
      _asm {
295
      _asm {
296
        push ax
296
        push ax
297
        push dx
297
        push dx
298
        mov ah, 0x09
298
        mov ah, 0x09
Line 355... Line 355...
355
    /* update rmod's ptr to COMPSPEC so it is always up to date */
355
    /* update rmod's ptr to COMPSPEC so it is always up to date */
356
    rmod_updatecomspecptr(rmod_seg, *rmod_envseg);
356
    rmod_updatecomspecptr(rmod_seg, *rmod_envseg);
357
 
357
 
358
    /* try matching (and executing) an internal command */
358
    /* try matching (and executing) an internal command */
359
    {
359
    {
360
      int ecode = cmd_process(*rmod_envseg, cmdline);
360
      int ecode = cmd_process(*rmod_envseg, cmdline, BUFFER);
361
      if (ecode >= 0) *lastexitcode = ecode;
361
      if (ecode >= 0) *lastexitcode = ecode;
362
      if (ecode >= -1) continue; /* internal command executed */
362
      if (ecode >= -1) continue; /* internal command executed */
363
    }
363
    }
364
 
364
 
365
    /* if here, then this was not an internal command */
365
    /* if here, then this was not an internal command */