Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1724 → Rev 1725

/svarcom/trunk/cmd/dir.c
416,7 → 416,6
}
}
 
if (req->filespecptr == NULL) req->filespecptr = ".";
return(0);
}
 
439,16 → 438,8
unsigned long summary_fcount = 0;
unsigned long summary_totsz = 0;
unsigned char drv = 0;
 
struct dirrequest req;
 
/* preload req with default values */
bzero(&req, sizeof(req));
req.attrfilter_may = DIR_ATTR_DEFAULT;
/* req.attrfilter_must = 0;
req.flags = 0; */
req.format = DIR_OUTPUT_NORM;
 
/* make sure there's no risk of buffer overflow */
if (sizeof(buf) > p->BUFFERSZ) {
outputnl("INTERNAL MEM ERROR IN " __FILE__);
485,9 → 476,37
/* disable usage of thousands separator on narrow screens */
if (screenw < 80) buf->nls.thousep[0] = 0;
 
/* parse command line */
/*** PARSING COMMAND LINE STARTS *******************************************/
 
/* init req with some defaults */
bzero(&req, sizeof(req));
req.attrfilter_may = DIR_ATTR_DEFAULT;
req.format = DIR_OUTPUT_NORM;
 
/* process DIRCMD first (so it can be overidden by user's cmdline) */
{
const char far *dircmd = env_lookup_val(p->env_seg, "DIRCMD");
if (dircmd != NULL) {
const char *argvptrs[32];
cmd_explode(buf->buff64, dircmd, argvptrs);
if ((dir_parse_cmdline(&req, argvptrs) != 0) || (req.filespecptr != NULL)) {
nls_output(255, 10);/* bad environment */
output(" - ");
outputnl("DIRCMD");
return(CMD_FAIL);
}
}
}
 
/* parse user's command line */
if (dir_parse_cmdline(&req, p->argv) != 0) return(CMD_FAIL);
 
/* if no filespec provided, then it's about the current directory */
if (req.filespecptr == NULL) req.filespecptr = ".";
 
/*** PARSING COMMAND LINE DONE *********************************************/
 
 
availrows = screen_getheight() - 2;
 
/* special case: "DIR drive:" (truename() fails on "C:" under MS-DOS 6.0) */
/svarcom/trunk/history.txt
9,6 → 9,7
=== ver 2024.2 (xx.xx.2024) ==================================================
 
- DIR command: added /O support
- DIR command: %DIRCMD% support
- command-line parsing modified to work around a DN bug. Thanks to bttr for
reporting the issue and to ECM for locating the root cause.
ref: https://github.com/SvarDOS/bugz/issues/67