env.com behaves more like env

It prints its own name to stderr, not stdout.

It also prints `GetProgramExecutableName()` for further debugging
convenience.
This commit is contained in:
Jōshin 2023-12-14 19:52:49 -05:00
parent bf952027c3
commit 2b2a38b5ae
No known key found for this signature in database

View file

@ -2,9 +2,9 @@
#include "libc/runtime/runtime.h"
int main(int argc, char* argv[]) {
printf("%s\n", argv[0]);
fprintf(stderr, "%s (%s)\n", argv[0], GetProgramExecutableName());
for (char **p = environ; *p; ++p) {
printf(" %s\n", *p);
printf("%s\n", *p);
}
return 0;
}