Take length in consideration before moving the echo off upwards.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4106
This commit is contained in:
parent
85789a06da
commit
80740117b9
1 changed files with 4 additions and 2 deletions
|
@ -368,11 +368,13 @@ public:
|
|||
char * extra = const_cast<char*>(section->data.c_str());
|
||||
if (extra && !secure && !control->cmdline->FindExist("-noautoexec",true)) {
|
||||
/* detect if "echo off" is the first line */
|
||||
size_t firstline_length = strcspn(extra,"\r\n");
|
||||
bool echo_off = !strncasecmp(extra,"echo off",8);
|
||||
if (echo_off) extra += 8;
|
||||
if (echo_off && firstline_length == 8) extra += 8;
|
||||
else {
|
||||
echo_off = !strncasecmp(extra,"@echo off",9);
|
||||
if (echo_off) extra += 9;
|
||||
if (echo_off && firstline_length == 9) extra += 9;
|
||||
else echo_off = false;
|
||||
}
|
||||
|
||||
/* if "echo off" move it to the front of autoexec.bat */
|
||||
|
|
Loading…
Add table
Reference in a new issue