Subversion Repositories SvarDOS

Rev

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

Rev 1358 Rev 1359
Line 494... Line 494...
494
  del(db);
494
  del(db);
495
}
495
}
496
 
496
 
497
 
497
 
498
/* returns 0 on success, 1 on file not found, 2 on other error */
498
/* returns 0 on success, 1 on file not found, 2 on other error */
499
static unsigned char loadfile(struct file *db, const char *fname) {
499
static int loadfile(struct file *db, const char *fname) {
500
  char buff[512]; /* read one entire sector at a time (faster) */
500
  char buff[512]; /* read one entire sector at a time (faster) */
501
  char *buffptr;
501
  char *buffptr;
502
  unsigned int len, llen;
502
  unsigned int len, llen;
503
  int fd;
503
  int fd;
504
  unsigned char eolfound;
504
  unsigned char eolfound;
Line 605... Line 605...
605
static int parseargv(struct file *dbarr) {
605
static int parseargv(struct file *dbarr) {
606
  char *tail = (void *)0x81; /* THIS WORKS ONLY IN SMALL MEMORY MODEL */
606
  char *tail = (void *)0x81; /* THIS WORKS ONLY IN SMALL MEMORY MODEL */
607
  unsigned short count = 0;
607
  unsigned short count = 0;
608
  char *arg;
608
  char *arg;
609
  unsigned short lastarg = 0;
609
  unsigned short lastarg = 0;
610
  unsigned short err;
610
  int err;
611
 
611
 
612
  while (!lastarg) {
612
  while (!lastarg) {
613
    /* jump to nearest arg */
613
    /* jump to nearest arg */
614
    while (*tail == ' ') {
614
    while (*tail == ' ') {
615
      *tail = 0;
615
      *tail = 0;
Line 951... Line 951...
951
          if (db->modflag != 0) ui_msg(svarlang_str(0,4), svarlang_str(0,8), SCHEME_MSG);
951
          if (db->modflag != 0) ui_msg(svarlang_str(0,4), svarlang_str(0,8), SCHEME_MSG);
952
 
952
 
953
          /* ask for filename */
953
          /* ask for filename */
954
          ui_getstring(svarlang_str(0,7), fname, sizeof(fname));
954
          ui_getstring(svarlang_str(0,7), fname, sizeof(fname));
955
          if (fname[0] != 0) {
955
          if (fname[0] != 0) {
956
            unsigned char err;
956
            int err;
957
            err = loadfile(db, fname);
957
            err = loadfile(db, fname);
958
            if (err != 0) {
958
            if (err != 0) {
959
              if (err == 1) {
959
              if (err == 1) {
960
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
960
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
961
              } else {
961
              } else {