Skip to content

Commit

Permalink
Debug more
Browse files Browse the repository at this point in the history
  • Loading branch information
ojwb committed Dec 23, 2024
1 parent 2b9c4aa commit 5ed7dfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/survexport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ using namespace std;
int
main(int argc, char **argv)
{
printf("argc = %d\n", argc);
for (int i = 0; i < argc; ++i) {
printf("argv[%d] = %s\n", i, argv[i] ? argv[i] : "<<<NULL>>>");
}
double pan = 0;
double tilt = -90.0;
export_format format = FMT_MAX_PLUS_ONE_;
Expand Down
4 changes: 0 additions & 4 deletions src/wrapsurvexport.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,17 @@ main(int argc, char **argv)
e_len = 1;
a_len = 0;
}
printf("argv[0] = %s\n", argv[0]);
char *e = malloc(e_len + strlen("OPENSSL_MODULES=") + 1);
if (!e) return 1;
strcpy(e, "OPENSSL_MODULES=");
memcpy(e + strlen("OPENSSL_MODULES="), e_val, e_len);
e[strlen("OPENSSL_MODULES=") + e_len] = '\0';
putenv(e);
printf("putenv(%s)\n", e);
char *a = malloc(a_len + strlen("survexpor_.exe") + 1);
if (!a) return 1;
memcpy(a, argv[0], a_len);
strcpy(a + a_len, "survexpor_.exe");
printf("a = %s\n", a);
const char *real_argv0 = argv[0];
if (getenv("OLLY")) argv[0] = a;
_execv(a, (const char * const*)argv);
printf("%s: %s\n", real_argv0, strerror(errno));
return 1;
Expand Down

0 comments on commit 5ed7dfe

Please sign in to comment.