]>
Commit | Line | Data |
---|---|---|
4f69c81f | 1 | --- dosemu-1.0.2/src/plugin/commands/comcom.c.orig Fri May 10 20:50:04 2002 |
2 | +++ dosemu-1.0.2/src/plugin/commands/comcom.c Fri May 10 20:57:14 2002 | |
3 | @@ -104,6 +104,7 @@ | |
4 | struct res_dta { | |
5 | struct batchdata *current_bdta; | |
6 | int exitcode; | |
7 | + int errorlevel; /* exit code for external commands */ | |
8 | int need_errprinting; | |
9 | int echo_on; | |
10 | int envsize; /* size of enlarged enviroment */ | |
11 | @@ -1277,7 +1278,7 @@ | |
12 | if (!strcasecmp(argv[argi], "errorlevel")) { | |
13 | if (argi+2 >= argc) return DOS_EINVAL; | |
14 | level = strtoul(argv[argi+1], 0, 10); | |
15 | - if (((EXITCODE >= level) ? 1 : 0) ^ invers) { | |
16 | + if (((rdta->errorlevel >= level) ? 1 : 0) ^ invers) { | |
17 | argi += 2; | |
18 | SET_CHILD_ARGS(argi); | |
19 | dopath_exec(argc-argi, argv+argi); | |
20 | @@ -2740,6 +2741,7 @@ | |
21 | saved_cannotexit = rdta->cannotexit; | |
22 | rdta->cannotexit = 0; | |
23 | ret = load_and_run_DOS_program(name, cmdline); | |
24 | + rdta->errorlevel = ret; | |
25 | rdta->cannotexit = saved_cannotexit; | |
26 | ||
27 | /* re-enlarge the environment to maximum */ | |
28 | @@ -3256,6 +3258,7 @@ | |
29 | rdta->need_errprinting = 0; | |
30 | ||
31 | EXITCODE = 0; | |
32 | + rdta->errorlevel = 0; | |
33 | ECHO_ON = 1; | |
34 | ||
35 | /* first free all memory we don't need for ourselves, such that |