Subversion Repositories SvarDOS

Rev

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

Rev 1556 Rev 1557
Line 112... Line 112...
112
  _dos_freemem(FP_SEG(ptr));
112
  _dos_freemem(FP_SEG(ptr));
113
}
113
}
114
 
114
 
115
 
115
 
116
static int curline_resize(struct file *db, unsigned short newsiz) {
116
static int curline_resize(struct file *db, unsigned short newsiz) {
117
  unsigned short maxavail;
-
 
118
  struct line far *newptr;
117
  struct line far *newptr;
119
 
118
 
120
  /* try resizing the block (much faster) */
119
  /* try resizing the block (much faster) */
121
  if (mdr_dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor), &maxavail) == 0) return(0);
120
  if (mdr_dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor)) == 0) return(0);
122
 
121
 
123
  /* create a new block and copy data over */
122
  /* create a new block and copy data over */
124
  newptr = line_calloc(newsiz);
123
  newptr = line_calloc(newsiz);
125
  if (newptr == NULL) return(-1);
124
  if (newptr == NULL) return(-1);
126
  _fmemmove(newptr, db->cursor, sizeof(struct line) + db->cursor->len);
125
  _fmemmove(newptr, db->cursor, sizeof(struct line) + db->cursor->len);