mawk 1.3.4 20240622 for DOS (Announce)
> Here's the output that I got in MS-DOS 7.1 when I run your test program (
> with msvcrt.dll from XP SP3 ):
>
>
> test.awk: cd
> C:\TEMP\bin
>
> test.awk: c:\temp\bin\mawk.exe "BEGIN{print \"hi\"}"
> hi
>
>
> haven't tried the dll of your link yet...
>
> EDIT: tried "your" dll, same result as above.
Curiouser and curiouser...
I reproduced the problem on MS-DOS 6.22. That eliminates FreeDOS.
I reproduced the problem in a Watcom win32 build of mawk. That eliminates mingw and MSVCRT.DLL.
I reproduced the problem using short sample C code built with Watcom. That eliminates mawk.
Note how the win32 version of test2.exe inserts extraneous arguments when it uses the system() C library call, but the DOS version doesn't.
https://bencollver.bitbucket.io/files/hxtest.zip
C:\hxtest\dos>test.exe foo bar
COMSPEC=C:\FreeDOS\BIN\COMMAND.COM
argc=3
argv[0]=C:\HXTEST\DOS\TEST.EXE
argv[1]=foo
argv[2]=bar
C:\hxtest\dos>test2.exe test.exe foo bar
COMSPEC=C:\FreeDOS\BIN\COMMAND.COM
argc=3
argv[0]=C:\HXTEST\DOS\TEST.EXE
argv[1]=foo
argv[2]=bar
C:\hxtest\win32>test.exe foo bar
DPMILD32: Module=hxguihlp.dll
DPMILD32: File not found error
COMSPEC=C:\FreeDOS\BIN\COMMAND.COM
argc=3
argv[0]=c:\hxtest\win32\test.exe
argv[1]=foo
argv[2]=bar
C:\hxtest\win32>test2.exe test.exe foo bar
DPMILD32: Module=hxguihlp.dll
DPMILD32: File not found error
DPMILD32: Module=hxguihlp.dll
DPMILD32: File not found error
COMSPEC=C:\FreeDOS\BIN\COMMAND.COM
argc=5
argv[0]=c:\hxtest\win32\test.exe
argv[1]=/c
argv[2]=test.exe
argv[3]=foo
argv[4]=bar
C:\hxtest>type test.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int i;
char *str;
str = getenv("COMSPEC");
printf("COMSPEC=%s\n", str);
printf("argc=%d\n", argc);
for (i = 0; i < argc; i++) {
printf("argv[%d]=%s\n", i, argv[i]);
}
exit(0);
}
C:\hxtest>type test2.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
int i, result;
char buf[256];
if (argc < 1) {
printf("Usage: test2.exe args...\n");
exit(1);
}
strcpy(buf, argv[1]);
for (i = 2; i < argc; i++) {
strcat(buf, " ");
strcat(buf, argv[i]);
}
result = system(buf);
exit(result);
}
Complete thread:
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 03:27 (Announce)
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 06:57
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 16:27
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 16:40
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 17:33
- mawk 1.3.4 20240622 for DOS - Rugxulo, 16.08.2024, 04:21
- mawk 1.3.4 20240622 for DOS - bencollver, 16.08.2024, 04:45
- mawk 1.3.4 20240622 for DOS - Oso2k, 16.08.2024, 15:27
- mawk 1.3.4 20240622 for DOS - Rugxulo, 25.08.2024, 01:09
- mawk 1.3.4 20240622 for DOS - Japheth, 25.08.2024, 07:04
- mawk 1.3.4 20240622 for DOS - Rugxulo, 16.08.2024, 04:21
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 17:33
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 16:40
- mawk 1.3.4 20240622 for DOS - bencollver, 20.08.2024, 03:35
- mawk 1.3.4 20240622 for DOS - Japheth, 20.08.2024, 13:27
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 00:38
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 12:50
- mawk 1.3.4 20240622 for DOS - Japheth, 21.08.2024, 17:02
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 18:55
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 23:25
- mawk 1.3.4 20240622 for DOS - bencollver, 22.08.2024, 02:09
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 00:55
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 03:08
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 08:14
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 17:34
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 19:22
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 19:53
- mawk 1.3.4 20240622 for DOS - Japheth, 03.09.2024, 21:26
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 19:53
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 19:22
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 17:34
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 08:14
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 03:08
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 00:55
- mawk 1.3.4 20240622 for DOS - bencollver, 22.08.2024, 02:09
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 23:25
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 18:55
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 00:38
- mawk 1.3.4 20240622 for DOS - Japheth, 20.08.2024, 13:27
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 16:27
- mawk 1.3.4 20240622 for DOS - bencollver, 24.08.2024, 04:55
- mawk 1.3.4 20240622 for DOS - Rugxulo, 24.08.2024, 13:34
- mawk 1.3.4 20240622 for DOS - bencollver, 24.08.2024, 18:05
- mawk 1.3.4 20240622 for DOS - Rugxulo, 24.08.2024, 13:34
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 06:57