mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
Ctrl+C to break from commands like DIR /S
This commit is contained in:
11
CHANGELOG
11
CHANGELOG
@@ -1,4 +1,11 @@
|
||||
0.83.11
|
||||
- You can now press Ctrl+C or Ctrl+Break to break
|
||||
from long outputs from commands like COPY, TYPE,
|
||||
DIR /S, and ATTRIB /S. (Wengier)
|
||||
- DELTREE is now an external command appearing on
|
||||
drive Z: as DELTREE.EXE instead of a builtin shell
|
||||
command, since it is an external command in a real
|
||||
DOS system. (Wengier).
|
||||
- Added CHCP command to view current code page, or
|
||||
change the current code page in the TrueType font
|
||||
output. Supported code pages include 437, 808, 850,
|
||||
@@ -41,9 +48,13 @@
|
||||
to 437 if current codepage is different. (Wengier)
|
||||
- The setting "output=default" will enable the OpenGL
|
||||
output for the Linux platform if possible. (Wengier)
|
||||
- Fixed an issue in MinGW builds that no data will be
|
||||
sent to the OPL3Duo board. (DhrBaksteen)
|
||||
- Fixed that the "Save" button in Configuration Tool
|
||||
did not save config file in last version. (Wengier)
|
||||
- Integrated SVN commits (Allofich)
|
||||
- r4330: some big endian improvents and drive_fat
|
||||
fixes. (jmarsh)
|
||||
- r4320: Report Q-Channel track number in BCD,
|
||||
meaning it is not converted to binary by the
|
||||
CD-ROM device driver. Fixes the CD-Player feature
|
||||
|
@@ -44,7 +44,7 @@ If you prefer to use one of the portable packages, please select the zip package
|
||||
|
||||
Both RPM and Flatpak packages are officially released for the Linux operating system (with X11). You can select one of these packages depending on your Linux system and your needs. The Linux Fatpak package has the advantage of being supported by most or all Linux distributions, but it will run in a sandbox on your Linux system so that you may not able to access some system-wide resources.
|
||||
|
||||
(RPM package to be updated for version 0.83.10)
|
||||
RPM packages are not available for the current version 0.83.10, but they are available for the previous version 0.83.9:
|
||||
|
||||
The standard RPM package is available for 64-bit Linux, specifically CentOS 7 / RHEL 7 ("el7") platforms:
|
||||
|
||||
|
15
README.md
15
README.md
@@ -340,12 +340,19 @@ See also the [CREDITS](CREDITS.md) page for crediting of the source code.
|
||||
|
||||
## Known DOSBox-X forks
|
||||
|
||||
DOSBox-X Emscripten port (runnable in a web browser) by Yksoft1.
|
||||
Significant changes are made in order to run efficiently within the web browser when compiled using LLVM/Emscripten.
|
||||
These significant changes require dropping some useful features (including the menus) but are required for performance.
|
||||
* DOSBox-X Emscripten port (runnable in a web browser) by Yksoft1
|
||||
|
||||
URL: https://github.com/yksoft1/dosbox-x-vanilla-sdl/tree/emscripten (look for clone URL and use the emscripten branch)
|
||||
Significant changes are made in order to run efficiently within the web browser when compiled using LLVM/Emscripten.
|
||||
These significant changes require dropping some useful features (including the menus) but are required for performance.
|
||||
|
||||
URL: https://github.com/yksoft1/dosbox-x-vanilla-sdl/tree/emscripten (look for clone URL and use the emscripten branch)
|
||||
|
||||
* Win31DOSBox (Windows 3.1 for 64-bit Windows) by emendelson
|
||||
|
||||
Win31DOSBox aims to be an easy method of running Windows 3.x software for 64-bit Windows systems.
|
||||
The system uses a custom build of DOSBox-X when running Windows 3.1x.
|
||||
|
||||
URL: http://www.columbia.edu/~em36/win31dosbox.html
|
||||
|
||||
## Support for international language translations and keyboard layouts
|
||||
|
||||
|
@@ -6207,6 +6207,44 @@ static void LS_ProgramStart(Program * * make) {
|
||||
*make=new LS;
|
||||
}
|
||||
|
||||
class DELTREE : public Program {
|
||||
public:
|
||||
void Run(void);
|
||||
private:
|
||||
void PrintUsage() {
|
||||
constexpr const char *msg =
|
||||
"Deletes a directory and all the subdirectories and files in it.\n\n"
|
||||
"To delete one or more files and directories:\n"
|
||||
"DELTREE [/Y] [drive:]path [[drive:]path[...]]\n\n"
|
||||
" /Y Suppresses prompting to confirm you want to delete\n"
|
||||
" the subdirectory.\n"
|
||||
" [drive:]path Specifies the name of the directory you want to delete.\n\n"
|
||||
"Note: Use DELTREE cautiously. Every file and subdirectory within the\n"
|
||||
"specified directory will be deleted.\n";
|
||||
WriteOut(msg);
|
||||
}
|
||||
};
|
||||
|
||||
void DELTREE::Run()
|
||||
{
|
||||
// Hack To allow long commandlines
|
||||
ChangeToLongCmd();
|
||||
|
||||
// Usage
|
||||
if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) {
|
||||
PrintUsage();
|
||||
return;
|
||||
}
|
||||
char *args=(char *)cmd->GetRawCmdline().c_str();
|
||||
args=trim(args);
|
||||
DOS_Shell temp;
|
||||
temp.CMD_DELTREE(args);
|
||||
}
|
||||
|
||||
static void DELTREE_ProgramStart(Program * * make) {
|
||||
*make=new DELTREE;
|
||||
}
|
||||
|
||||
#if defined(USE_TTF)
|
||||
typedef struct {uint8_t red; uint8_t green; uint8_t blue; uint8_t alpha;} alt_rgb;
|
||||
alt_rgb altBGR[16], *rgbcolors = (alt_rgb*)render.pal.rgb;
|
||||
@@ -7298,6 +7336,7 @@ void DOS_SetupPrograms(void) {
|
||||
PROGRAMS_MakeFile("ADDKEY.COM",ADDKEY_ProgramStart);
|
||||
PROGRAMS_MakeFile("A20GATE.COM",A20GATE_ProgramStart);
|
||||
PROGRAMS_MakeFile("CFGTOOL.COM",CFGTOOL_ProgramStart);
|
||||
PROGRAMS_MakeFile("DELTREE.EXE",DELTREE_ProgramStart);
|
||||
PROGRAMS_MakeFile("FLAGSAVE.COM", FLAGSAVE_ProgramStart);
|
||||
#if defined C_DEBUG
|
||||
PROGRAMS_MakeFile("INT2FDBG.COM",INT2FDBG_ProgramStart);
|
||||
|
@@ -1005,7 +1005,7 @@ void SHELL_Init() {
|
||||
MSG_Add("SHELL_ILLEGAL_CONTROL_CHARACTER","Unexpected control character: Dec %03u and Hex %#04x.\n");
|
||||
MSG_Add("SHELL_ILLEGAL_SWITCH","Invalid switch - %s\n");
|
||||
MSG_Add("SHELL_MISSING_PARAMETER","Required parameter missing.\n");
|
||||
MSG_Add("SHELL_CMD_CHDIR_ERROR","Unable to change to: %s.\n");
|
||||
MSG_Add("SHELL_CMD_CHDIR_ERROR","Invalid directory - %s\n");
|
||||
MSG_Add("SHELL_CMD_CHDIR_HINT","Hint: To change to different drive type \033[31m%c:\033[0m\n");
|
||||
MSG_Add("SHELL_CMD_CHDIR_HINT_2","directoryname contains unquoted spaces.\nTry \033[31mcd %s\033[0m or properly quote them with quotation marks.\n");
|
||||
MSG_Add("SHELL_CMD_CHDIR_HINT_3","You are still on drive Z:, change to a mounted drive with \033[31mC:\033[0m.\n");
|
||||
@@ -1028,12 +1028,12 @@ void SHELL_Init() {
|
||||
" time: New time to set\n"\
|
||||
" /T: Display simple time\n"\
|
||||
" /H: Synchronize with host\n");
|
||||
MSG_Add("SHELL_CMD_MKDIR_ERROR","Unable to make: %s.\n");
|
||||
MSG_Add("SHELL_CMD_RMDIR_ERROR","Unable to remove: %s.\n");
|
||||
MSG_Add("SHELL_CMD_RENAME_ERROR","Unable to rename: %s.\n");
|
||||
MSG_Add("SHELL_CMD_MKDIR_ERROR","Unable to create directory - %s\n");
|
||||
MSG_Add("SHELL_CMD_RMDIR_ERROR","Invalid path, not directory, or directory not empty - %s\n");
|
||||
MSG_Add("SHELL_CMD_RENAME_ERROR","Unable to rename - %s\n");
|
||||
MSG_Add("SHELL_CMD_ATTRIB_GET_ERROR","Unable to get attributes: %s\n");
|
||||
MSG_Add("SHELL_CMD_ATTRIB_SET_ERROR","Unable to set attributes: %s\n");
|
||||
MSG_Add("SHELL_CMD_DEL_ERROR","Unable to delete: %s.\n");
|
||||
MSG_Add("SHELL_CMD_DEL_ERROR","Unable to delete - %s\n");
|
||||
MSG_Add("SHELL_CMD_DEL_SURE","All files in directory will be deleted!\nAre you sure [Y/N]?");
|
||||
MSG_Add("SHELL_SYNTAXERROR","Syntax error\n");
|
||||
MSG_Add("SHELL_CMD_SET_NOT_SET","Environment variable %s not defined.\n");
|
||||
@@ -1061,11 +1061,11 @@ void SHELL_Init() {
|
||||
MSG_Add("SHELL_CMD_PAUSE","Press any key to continue . . .\n");
|
||||
MSG_Add("SHELL_CMD_PAUSE_HELP","Waits for one keystroke to continue.\n");
|
||||
MSG_Add("SHELL_CMD_PAUSE_HELP_LONG","PAUSE\n");
|
||||
MSG_Add("SHELL_CMD_COPY_FAILURE","Copy failure : %s.\n");
|
||||
MSG_Add("SHELL_CMD_COPY_FAILURE","Copy failure - %s\n");
|
||||
MSG_Add("SHELL_CMD_COPY_SUCCESS"," %d File(s) copied.\n");
|
||||
MSG_Add("SHELL_CMD_COPY_CONFIRM","Overwrite %s (Yes/No/All)?");
|
||||
MSG_Add("SHELL_CMD_COPY_NOSPACE","Insufficient disk space - %s\n");
|
||||
MSG_Add("SHELL_CMD_COPY_ERROR","Error in copying file %s\n");
|
||||
MSG_Add("SHELL_CMD_COPY_ERROR","Copy error - %s\n");
|
||||
MSG_Add("SHELL_CMD_SUBST_DRIVE_LIST","The currently mounted local drives are:\n");
|
||||
MSG_Add("SHELL_CMD_SUBST_NO_REMOVE","Unable to remove, drive not in use.\n");
|
||||
MSG_Add("SHELL_CMD_SUBST_IN_USE","Target drive is already in use.\n");
|
||||
@@ -1318,14 +1318,6 @@ void SHELL_Init() {
|
||||
" /P Prompts for confirmation before deleting one or more files.\n"
|
||||
" /F Force deleting of read-only files.\n"
|
||||
" /Q Quiet mode, do not ask if ok to delete on global wildcard.\n");
|
||||
MSG_Add("SHELL_CMD_DELTREE_HELP","Deletes a directory and all the subdirectories and files in it.\n");
|
||||
MSG_Add("SHELL_CMD_DELTREE_HELP_LONG","To delete one or more files and directories:\n"
|
||||
"DELTREE [/Y] [drive:]path [[drive:]path[...]]\n\n"
|
||||
" /Y Suppresses prompting to confirm you want to delete\n"
|
||||
" the subdirectory.\n"
|
||||
" [drive:]path Specifies the name of the directory you want to delete.\n\n"
|
||||
"Note: Use DELTREE cautiously. Every file and subdirectory within the\n"
|
||||
"specified directory will be deleted.\n");
|
||||
MSG_Add("SHELL_CMD_COPY_HELP","Copies one or more files.\n");
|
||||
MSG_Add("SHELL_CMD_COPY_HELP_LONG","COPY [/Y | /-Y] source [+source [+ ...]] [destination]\n\n"
|
||||
" source Specifies the file or files to be copied.\n"
|
||||
|
@@ -16,8 +16,8 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Heavy improvements by the DOSBox-X Team, 2011-2020
|
||||
* DXCAPTURE, DEBUGBOX, INT2FDBG commands by joncampbell123
|
||||
* ATTRIB, COUNTRY, DELTREE, FOR, LFNFOR, VERIFY, TRUENAME commands by Wengier
|
||||
* DX-CAPTURE, DEBUGBOX, INT2FDBG commands by joncampbell123
|
||||
* ATTRIB, CHCP, COUNTRY, DELTREE, FOR, LFNFOR, VERIFY, TRUENAME commands by Wengier
|
||||
* LS command by the DOSBox Staging Team and Wengier
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ SHELL_Cmd cmd_list[]={
|
||||
{ "CTTY", 1, &DOS_Shell::CMD_CTTY, "SHELL_CMD_CTTY_HELP"},
|
||||
{ "DATE", 0, &DOS_Shell::CMD_DATE, "SHELL_CMD_DATE_HELP"},
|
||||
{ "DEL", 0, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"},
|
||||
{ "DELTREE", 1, &DOS_Shell::CMD_DELTREE, "SHELL_CMD_DELTREE_HELP"},
|
||||
//{ "DELTREE", 1, &DOS_Shell::CMD_DELTREE, "SHELL_CMD_DELTREE_HELP"}, // DELTREE as a program (Z:\DELTREE.EXE) instead of shell command
|
||||
{ "ECHO", 0, &DOS_Shell::CMD_ECHO, "SHELL_CMD_ECHO_HELP"},
|
||||
{ "ERASE", 1, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"},
|
||||
{ "EXIT", 0, &DOS_Shell::CMD_EXIT, "SHELL_CMD_EXIT_HELP"},
|
||||
@@ -99,14 +99,14 @@ SHELL_Cmd cmd_list[]={
|
||||
{ "VERIFY", 1, &DOS_Shell::CMD_VERIFY, "SHELL_CMD_VERIFY_HELP"},
|
||||
{ "VOL", 0, &DOS_Shell::CMD_VOL, "SHELL_CMD_VOL_HELP"},
|
||||
{ "TRUENAME", 1, &DOS_Shell::CMD_TRUENAME, "SHELL_CMD_TRUENAME_HELP"},
|
||||
// Advanced commands specific to DOSBox-X
|
||||
//{ "ADDKEY", 1, &DOS_Shell::CMD_ADDKEY, "SHELL_CMD_ADDKEY_HELP"}, // ADDKEY as a program (Z:\ADDKEY.COM) instead of shell command
|
||||
{ "DX-CAPTURE", 1, &DOS_Shell::CMD_DXCAPTURE, "SHELL_CMD_DXCAPTURE_HELP"},
|
||||
#if C_DEBUG
|
||||
// Additional commands for debugging purposes in DOSBox-X
|
||||
{ "DEBUGBOX", 1, &DOS_Shell::CMD_DEBUGBOX, "SHELL_CMD_DEBUGBOX_HELP"},
|
||||
//{ "INT2FDBG", 1, &DOS_Shell::CMD_INT2FDBG, "SHELL_CMD_INT2FDBG_HELP"}, // INT2FDBG as a program (Z:\INT2FDBG.COM) instead of shell command
|
||||
#endif
|
||||
// Advanced commands specific to DOSBox-X
|
||||
//{ "ADDKEY", 1, &DOS_Shell::CMD_ADDKEY, "SHELL_CMD_ADDKEY_HELP"}, // ADDKEY as a program (Z:\ADDKEY.COM) instead of shell command
|
||||
{ "DX-CAPTURE", 1, &DOS_Shell::CMD_DXCAPTURE, "SHELL_CMD_DXCAPTURE_HELP"},
|
||||
{0,0,0,0}
|
||||
};
|
||||
|
||||
@@ -751,7 +751,7 @@ static bool doDeltree(DOS_Shell * shell, char * args, DOS_DTA dta, bool optY, bo
|
||||
}
|
||||
|
||||
void DOS_Shell::CMD_DELTREE(char * args) {
|
||||
HELP("DELTREE");
|
||||
//HELP("DELTREE");
|
||||
StripSpaces(args);
|
||||
bool optY=ScanCMDBool(args,"Y");
|
||||
char * rem=ScanCMDRemain(args);
|
||||
@@ -1250,7 +1250,6 @@ char *FormatTime(Bitu hour, Bitu min, Bitu sec, Bitu msec) {
|
||||
uint32_t byte_count,file_count,dir_count;
|
||||
Bitu p_count;
|
||||
std::vector<std::string> dirs, adirs;
|
||||
|
||||
static bool dirPaused(DOS_Shell * shell, Bitu w_size, bool optP, bool optW) {
|
||||
p_count+=optW?5:1;
|
||||
if (optP && p_count%(GetPauseCount()*w_size)<1) {
|
||||
@@ -1263,6 +1262,18 @@ static bool dirPaused(DOS_Shell * shell, Bitu w_size, bool optP, bool optW) {
|
||||
return true;
|
||||
}
|
||||
|
||||
extern bool ctrlbrk;
|
||||
bool CheckBreak(DOS_Shell * shell) {
|
||||
if (ctrlbrk) {
|
||||
uint8_t c;uint16_t n=1;
|
||||
DOS_ReadFile (STDIN,&c,&n);
|
||||
if (c == 3) shell->WriteOut("^C\n");
|
||||
ctrlbrk=false;
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool doDir(DOS_Shell * shell, char * args, DOS_DTA dta, char * numformat, Bitu w_size, bool optW, bool optZ, bool optS, bool optP, bool optB, bool optA, bool optAD, bool optAminusD, bool optAS, bool optAminusS, bool optAH, bool optAminusH, bool optAR, bool optAminusR, bool optAA, bool optAminusA, bool optO, bool optOG, bool optON, bool optOD, bool optOE, bool optOS, bool reverseSort) {
|
||||
char path[DOS_PATHLENGTH];
|
||||
char sargs[CROSS_LEN], largs[CROSS_LEN];
|
||||
@@ -1349,7 +1360,7 @@ static bool doDir(DOS_Shell * shell, char * args, DOS_DTA dta, char * numformat,
|
||||
}
|
||||
|
||||
for (std::vector<DtaResult>::iterator iter = results.begin(); iter != results.end(); ++iter) {
|
||||
|
||||
if (CheckBreak(shell)) return false;
|
||||
char * name = iter->name;
|
||||
char *lname = iter->lname;
|
||||
uint32_t size = iter->size;
|
||||
@@ -1646,6 +1657,7 @@ void DOS_Shell::CMD_DIR(char * args) {
|
||||
dirs.clear();
|
||||
dirs.push_back(std::string(args));
|
||||
while (!dirs.empty()) {
|
||||
ctrlbrk=false;
|
||||
if (!doDir(this, (char *)dirs.begin()->c_str(), dta, numformat, w_size, optW, optZ, optS, optP, optB, optA, optAD, optAminusD, optAS, optAminusS, optAH, optAminusH, optAR, optAminusR, optAA, optAminusA, optO, optOG, optON, optOD, optOE, optOS, reverseSort)) {dos.dta(save_dta);return;}
|
||||
dirs.erase(dirs.begin());
|
||||
}
|
||||
@@ -1787,10 +1799,11 @@ void DOS_Shell::CMD_LS(char *args) {
|
||||
for (size_t i=0; i<col; i++) total+=max[i];
|
||||
if (total<tcols) break;
|
||||
}
|
||||
|
||||
ctrlbrk=false;
|
||||
w_count = p_count = 0;
|
||||
|
||||
for (const auto &entry : results) {
|
||||
if (CheckBreak(this)) {dos.dta(save_dta);return;}
|
||||
std::string name = uselfn&&!optZ?entry.lname:entry.name;
|
||||
if (name == "." || name == "..") continue;
|
||||
if (!optA && (entry.attr&DOS_ATTR_SYSTEM || entry.attr&DOS_ATTR_HIDDEN)) continue;
|
||||
@@ -2063,7 +2076,15 @@ void DOS_Shell::CMD_COPY(char * args) {
|
||||
}
|
||||
|
||||
bool echo=dos.echo, second_file_of_current_source = false;
|
||||
ctrlbrk=false;
|
||||
while (ret) {
|
||||
if (CheckBreak(this)) {
|
||||
dos.dta(save_dta);
|
||||
DOS_CloseFile(sourceHandle);
|
||||
if (targetHandle)
|
||||
DOS_CloseFile(targetHandle);
|
||||
return;
|
||||
}
|
||||
dta.GetResult(name,lname,size,date,time,attr);
|
||||
|
||||
if ((attr & DOS_ATTR_DIRECTORY)==0) {
|
||||
@@ -2169,10 +2190,8 @@ void DOS_Shell::CMD_COPY(char * args) {
|
||||
bool cont;
|
||||
do {
|
||||
if (!DOS_ReadFile(sourceHandle,buffer,&toread)) failed=true;
|
||||
if (iscon)
|
||||
{
|
||||
if (dos.errorcode==77)
|
||||
{
|
||||
if (iscon) {
|
||||
if (dos.errorcode==77) {
|
||||
WriteOut("^C\r\n");
|
||||
dos.dta(save_dta);
|
||||
DOS_CloseFile(sourceHandle);
|
||||
@@ -2180,23 +2199,21 @@ void DOS_Shell::CMD_COPY(char * args) {
|
||||
if (!exist) DOS_UnlinkFile(nameTarget);
|
||||
dos.echo=echo;
|
||||
return;
|
||||
}
|
||||
}
|
||||
cont=true;
|
||||
for (int i=0;i<toread;i++)
|
||||
if (buffer[i]==26)
|
||||
{
|
||||
if (buffer[i]==26) {
|
||||
toread=i;
|
||||
cont=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!DOS_WriteFile(targetHandle,buffer,&toread)) failed=true;
|
||||
if (cont) toread=0x8000;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (DOS_FindDevice(nameTarget)==DOS_FindDevice("con")&&CheckBreak(this)) {failed=true;break;}
|
||||
if (!DOS_WriteFile(targetHandle,buffer,&toread)) failed=true;
|
||||
cont=toread == 0x8000;
|
||||
}
|
||||
}
|
||||
} while (cont);
|
||||
if (!DOS_CloseFile(sourceHandle)) failed=true;
|
||||
#if defined(WIN32)
|
||||
@@ -2209,7 +2226,7 @@ void DOS_Shell::CMD_COPY(char * args) {
|
||||
WriteOut(" %s [%s]\n",lname,name);
|
||||
else
|
||||
WriteOut(" %s\n",uselfn?lname:name);
|
||||
if(!source.concat && !special) count++; //Only count concat files once
|
||||
if(!source.concat && !special && !failed) count++; //Only count concat files once
|
||||
} else {
|
||||
DOS_CloseFile(sourceHandle);
|
||||
WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),const_cast<char*>(target.filename.c_str()));
|
||||
@@ -2441,6 +2458,7 @@ nextfile:
|
||||
WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),word);
|
||||
return;
|
||||
}
|
||||
ctrlbrk=false;
|
||||
uint8_t c;uint16_t n=1;
|
||||
bool iscon=DOS_FindDevice(word)==DOS_FindDevice("con");
|
||||
while (n) {
|
||||
@@ -2449,7 +2467,7 @@ nextfile:
|
||||
if (iscon) {
|
||||
if (c==3) {WriteOut("^C\r\n");break;}
|
||||
else if (c==13) WriteOut("\r\n");
|
||||
}
|
||||
} else if (CheckBreak(this)) break;
|
||||
DOS_WriteFile(STDOUT,&c,&n);
|
||||
}
|
||||
DOS_CloseFile(handle);
|
||||
@@ -2926,6 +2944,7 @@ static bool doAttrib(DOS_Shell * shell, char * args, DOS_DTA dta, bool optS, boo
|
||||
char name[DOS_NAMELENGTH_ASCII],lname[LFN_NAMELENGTH+1];
|
||||
uint32_t size;uint16_t time,date;uint8_t attr;uint16_t fattr;
|
||||
while (res) {
|
||||
if (CheckBreak(shell)) {ctrlbrk=true;return false;}
|
||||
dta.GetResult(name,lname,size,date,time,attr);
|
||||
if (!((!strcmp(name, ".") || !strcmp(name, "..") || strchr(sargs, '*')!=NULL || strchr(sargs, '?')!=NULL) && attr & DOS_ATTR_DIRECTORY)) {
|
||||
found=true;
|
||||
@@ -3034,8 +3053,13 @@ void DOS_Shell::CMD_ATTRIB(char *args){
|
||||
adirs.push_back(std::string(args));
|
||||
bool found=false;
|
||||
while (!adirs.empty()) {
|
||||
ctrlbrk=false;
|
||||
if (doAttrib(this, (char *)adirs.begin()->c_str(), dta, optS, adda, adds, addh, addr, suba, subs, subh, subr))
|
||||
found=true;
|
||||
else if (ctrlbrk) {
|
||||
ctrlbrk=false;
|
||||
break;
|
||||
}
|
||||
adirs.erase(adirs.begin());
|
||||
}
|
||||
if (!found) WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),args);
|
||||
|
Reference in New Issue
Block a user