Line 799... |
Line 799... |
799 |
|
799 |
|
800 |
/* normalize "size" of directories to zero because kernel returns garbage
|
800 |
/* normalize "size" of directories to zero because kernel returns garbage
|
801 |
* sizes for directories which might confuse the sorting routine later */
|
801 |
* sizes for directories which might confuse the sorting routine later */
|
802 |
if (dta->attr & DOS_ATTR_DIR) dta->size = 0;
|
802 |
if (dta->attr & DOS_ATTR_DIR) dta->size = 0;
|
803 |
|
803 |
|
804 |
_fmemcpy(&(dtabuf[dtabufcount]), ((char *)dta) + 22, sizeof(struct TINYDTA));
|
804 |
memcpy_ltr_far(&(dtabuf[dtabufcount]), ((char *)dta) + 22, sizeof(struct TINYDTA));
|
805 |
|
805 |
|
806 |
/* save attribs in sec field, otherwise zero it (this field is not
|
806 |
/* save attribs in sec field, otherwise zero it (this field is not
|
807 |
* displayed and dropping the attr field saves 2 bytes per entry) */
|
807 |
* displayed and dropping the attr field saves 2 bytes per entry) */
|
808 |
dtabuf[dtabufcount++].time_sec2 = (dta->attr & 31);
|
808 |
dtabuf[dtabufcount++].time_sec2 = (dta->attr & 31);
|
809 |
|
809 |
|
Line 830... |
Line 830... |
830 |
for (i = 0; i < dtabufcount; i++) buf->orderidx[i] = i;
|
830 |
for (i = 0; i < dtabufcount; i++) buf->orderidx[i] = i;
|
831 |
qsort(buf->orderidx, dtabufcount, 2, &sortcmp);
|
831 |
qsort(buf->orderidx, dtabufcount, 2, &sortcmp);
|
832 |
|
832 |
|
833 |
/* preload first entry (last from orderidx, since entries are sorted in reverse) */
|
833 |
/* preload first entry (last from orderidx, since entries are sorted in reverse) */
|
834 |
dtabufcount--;
|
834 |
dtabufcount--;
|
835 |
_fmemcpy(((unsigned char *)dta) + 22, &(dtabuf[buf->orderidx[dtabufcount]]), sizeof(struct TINYDTA));
|
835 |
memcpy_ltr_far(((unsigned char *)dta) + 22, &(dtabuf[buf->orderidx[dtabufcount]]), sizeof(struct TINYDTA));
|
836 |
dta->attr = dtabuf[buf->orderidx[dtabufcount]].time_sec2; /* restore attr from the abused time_sec2 field */
|
836 |
dta->attr = dtabuf[buf->orderidx[dtabufcount]].time_sec2; /* restore attr from the abused time_sec2 field */
|
837 |
}
|
837 |
}
|
838 |
|
838 |
|
839 |
wcolcount = 0; /* may be used for columns counting with wide mode */
|
839 |
wcolcount = 0; /* may be used for columns counting with wide mode */
|
840 |
|
840 |
|
Line 922... |
Line 922... |
922 |
|
922 |
|
923 |
NEXT_ENTRY:
|
923 |
NEXT_ENTRY:
|
924 |
/* take next entry, either from buf or disk */
|
924 |
/* take next entry, either from buf or disk */
|
925 |
if (dtabufcount > 0) {
|
925 |
if (dtabufcount > 0) {
|
926 |
dtabufcount--;
|
926 |
dtabufcount--;
|
927 |
_fmemcpy(((unsigned char *)dta) + 22, &(dtabuf[buf->orderidx[dtabufcount]]), sizeof(struct TINYDTA));
|
927 |
memcpy_ltr_far(((unsigned char *)dta) + 22, &(dtabuf[buf->orderidx[dtabufcount]]), sizeof(struct TINYDTA));
|
928 |
dta->attr = dtabuf[buf->orderidx[dtabufcount]].time_sec2; /* restore attr from the abused time_sec2 field */
|
928 |
dta->attr = dtabuf[buf->orderidx[dtabufcount]].time_sec2; /* restore attr from the abused time_sec2 field */
|
929 |
} else {
|
929 |
} else {
|
930 |
if (findnext(dta) != 0) break;
|
930 |
if (findnext(dta) != 0) break;
|
931 |
}
|
931 |
}
|
932 |
|
932 |
|