Subversion Repositories SvarDOS

Rev

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

Rev 1448 Rev 1449
Line 536... Line 536...
536
  del(db);
536
  del(db);
537
}
537
}
538
 
538
 
539
 
539
 
540
/* returns 0 on success, 1 on file not found, 2 on other error */
540
/* returns 0 on success, 1 on file not found, 2 on other error */
541
static int loadfile(struct file *db, const char *fname) {
541
static unsigned char loadfile(struct file *db, const char *fname) {
542
  char buff[512]; /* read one entire sector at a time (faster) */
542
  char buff[512]; /* read one entire sector at a time (faster) */
543
  char *buffptr;
543
  char *buffptr;
544
  unsigned int len, llen;
544
  unsigned int len, llen;
545
  int fd;
545
  int fd;
546
  unsigned char eolfound;
546
  unsigned char eolfound;
547
  int err = 0;
547
  unsigned char err = 0;
548
 
548
 
549
  /* free the entire linked list of lines */
549
  /* free the entire linked list of lines */
550
  db_rewind(db);
550
  db_rewind(db);
551
  while (db->cursor) {
551
  while (db->cursor) {
552
    struct line far *victim;
552
    struct line far *victim;
Line 660... Line 660...
660
static int parseargv(struct file *dbarr) {
660
static int parseargv(struct file *dbarr) {
661
  char *tail = (void *)0x81; /* THIS WORKS ONLY IN SMALL MEMORY MODEL */
661
  char *tail = (void *)0x81; /* THIS WORKS ONLY IN SMALL MEMORY MODEL */
662
  unsigned short count = 0;
662
  unsigned short count = 0;
663
  char *arg;
663
  char *arg;
664
  unsigned short lastarg = 0;
664
  unsigned short lastarg = 0;
665
  int err;
665
  unsigned char err;
666
 
666
 
667
  while (!lastarg) {
667
  while (!lastarg) {
668
    /* jump to nearest arg */
668
    /* jump to nearest arg */
669
    while (*tail == ' ') {
669
    while (*tail == ' ') {
670
      *tail = 0;
670
      *tail = 0;
Line 1075... Line 1075...
1075
          if (db->modflag != 0) ui_msg(svarlang_str(0,4), svarlang_str(0,8), SCHEME_MSG);
1075
          if (db->modflag != 0) ui_msg(svarlang_str(0,4), svarlang_str(0,8), SCHEME_MSG);
1076
 
1076
 
1077
          /* ask for filename */
1077
          /* ask for filename */
1078
          ui_getstring(svarlang_str(0,7), fname, sizeof(fname));
1078
          ui_getstring(svarlang_str(0,7), fname, sizeof(fname));
1079
          if (fname[0] != 0) {
1079
          if (fname[0] != 0) {
1080
            int err;
1080
            unsigned char err;
1081
            err = loadfile(db, fname);
1081
            err = loadfile(db, fname);
1082
            if (err != 0) {
1082
            if (err != 0) {
1083
              if (err == 1) {
1083
              if (err == 1) {
1084
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
1084
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
1085
              } else {
1085
              } else {