Subversion Repositories SvarDOS

Rev

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

Rev 2213 Rev 2214
Line 208... Line 208...
208
  }
208
  }
209
  /* abort on error */
209
  /* abort on error */
210
  if (ostatni == -1) return;
210
  if (ostatni == -1) return;
211
  /* do the trick */
211
  /* do the trick */
212
  /* move ending to the right */
212
  /* move ending to the right */
213
  memcpy_rtl(path + ostatni + strlen(dirname) + 1, path + ostatni, strlen(path + ostatni) + 1);
213
  memcpy_rtl(path + ostatni + sv_strlen(dirname) + 1, path + ostatni, sv_strlen(path + ostatni) + 1);
214
  /* fill in the space with dirname */
214
  /* fill in the space with dirname */
215
  memcpy_ltr(path + ostatni + 1, dirname, strlen(dirname));
215
  memcpy_ltr(path + ostatni + 1, dirname, sv_strlen(dirname));
216
  //printf("'%s'\n", path);
216
  //printf("'%s'\n", path);
217
}
217
}
218
 
218
 
219
 
219
 
220
/* take back last dir from path, C:\XXX\YYY\*.EXE -> C:\XXX\*.EXE */
220
/* take back last dir from path, C:\XXX\YYY\*.EXE -> C:\XXX\*.EXE */
Line 573... Line 573...
573
  unsigned long summary_recurs_totsz = 0;  /* used for /s global summary */
573
  unsigned long summary_recurs_totsz = 0;  /* used for /s global summary */
574
  unsigned long summary_fcount;
574
  unsigned long summary_fcount;
575
  unsigned long summary_totsz;
575
  unsigned long summary_totsz;
576
  unsigned char drv = 0;
576
  unsigned char drv = 0;
577
  struct dirrequest req;
577
  struct dirrequest req;
578
  unsigned short summary_alignpos = strlen(svarlang_str(37,22)) + 2;
578
  unsigned short summary_alignpos = sv_strlen(svarlang_str(37,22)) + 2;
579
  unsigned short uint32maxlen = 14; /* 13 is the max len of a 32 bit number with thousand separators (4'000'000'000) */
579
  unsigned short uint32maxlen = 14; /* 13 is the max len of a 32 bit number with thousand separators (4'000'000'000) */
580
  if (screenw < 80) uint32maxlen = 10;
580
  if (screenw < 80) uint32maxlen = 10;
581
 
581
 
582
  if (cmd_ishlp(p)) {
582
  if (cmd_ishlp(p)) {
583
    nls_outputnl(37,0); /* "Displays a list of files and subdirectories in a directory" */
583
    nls_outputnl(37,0); /* "Displays a list of files and subdirectories in a directory" */
Line 855... Line 855...
855
    switch (req.format) {
855
    switch (req.format) {
856
      case DIR_OUTPUT_NORM:
856
      case DIR_OUTPUT_NORM:
857
        /* print fname-space-extension (unless it's "." or "..", then print as-is) */
857
        /* print fname-space-extension (unless it's "." or "..", then print as-is) */
858
        if (dta->fname[0] == '.') {
858
        if (dta->fname[0] == '.') {
859
          output(dta->fname);
859
          output(dta->fname);
860
          i = strlen(dta->fname);
860
          i = sv_strlen(dta->fname);
861
          while (i++ < 12) output(" ");
861
          while (i++ < 12) output(" ");
862
        } else {
862
        } else {
863
          file_fname2fcb(buf->buff64, dta->fname);
863
          file_fname2fcb(buf->buff64, dta->fname);
864
          memmove(buf->buff64 + 9, buf->buff64 + 8, 4);
864
          memcpy_rtl(buf->buff64 + 9, buf->buff64 + 8, 4);
865
          buf->buff64[8] = ' ';
865
          buf->buff64[8] = ' ';
866
          output(buf->buff64);
866
          output(buf->buff64);
867
        }
867
        }
868
        output(" ");
868
        output(" ");
869
        /* either <DIR> or right aligned 13 or 10 chars byte size, depending
869
        /* either <DIR> or right aligned 13 or 10 chars byte size, depending
870
         * on the presence of a thousands delimiter (max 2'000'000'000) */
870
         * on the presence of a thousands delimiter (max 2'000'000'000) */
871
        {
871
        {
872
          unsigned short szlen = 10 + (strlen(buf->nls.thousep) * 3);
872
          unsigned short szlen = 10 + (sv_strlen(buf->nls.thousep) * 3);
873
          memset(buf->buff64, ' ', 16);
873
          memset(buf->buff64, ' ', 16);
874
          if (dta->attr & DOS_ATTR_DIR) {
874
          if (dta->attr & DOS_ATTR_DIR) {
875
            strcpy(buf->buff64 + szlen, svarlang_str(37,21));
875
            strcpy(buf->buff64 + szlen, svarlang_str(37,21));
876
          } else {
876
          } else {
877
            nls_format_number(buf->buff64 + 12, dta->size, &(buf->nls));
877
            nls_format_number(buf->buff64 + 12, dta->size, &(buf->nls));
878
          }
878
          }
879
          output(buf->buff64 + strlen(buf->buff64) - szlen);
879
          output(buf->buff64 + sv_strlen(buf->buff64) - szlen);
880
        }
880
        }
881
        /* one spaces and NLS DATE */
881
        /* one spaces and NLS DATE */
882
        buf->buff64[0] = ' ';
882
        buf->buff64[0] = ' ';
883
        if (screenw >= 80) {
883
        if (screenw >= 80) {
884
          nls_format_date(buf->buff64 + 1, dta->date_yr + 1980, dta->date_mo, dta->date_dy, &(buf->nls));
884
          nls_format_date(buf->buff64 + 1, dta->date_yr + 1980, dta->date_mo, dta->date_dy, &(buf->nls));
Line 891... Line 891...
891
        nls_format_time(buf->buff64 + 1, dta->time_hour, dta->time_min, 0xff, &(buf->nls));
891
        nls_format_time(buf->buff64 + 1, dta->time_hour, dta->time_min, 0xff, &(buf->nls));
892
        outputnl(buf->buff64);
892
        outputnl(buf->buff64);
893
        break;
893
        break;
894
 
894
 
895
      case DIR_OUTPUT_WIDE: /* display in columns of 12 chars per item */
895
      case DIR_OUTPUT_WIDE: /* display in columns of 12 chars per item */
896
        i = strlen(dta->fname);
896
        i = sv_strlen(dta->fname);
897
        if (dta->attr & DOS_ATTR_DIR) {
897
        if (dta->attr & DOS_ATTR_DIR) {
898
          i += 2;
898
          i += 2;
899
          output("[");
899
          output("[");
900
          output(dta->fname);
900
          output(dta->fname);
901
          output("]");
901
          output("]");