equal
deleted
inserted
replaced
384 int i, cmd; |
384 int i, cmd; |
385 DWORD exitCode = 0; |
385 DWORD exitCode = 0; |
386 DWORD processFlags = 0; |
386 DWORD processFlags = 0; |
387 BOOL processInheritHandles = TRUE; |
387 BOOL processInheritHandles = TRUE; |
388 BOOL waitForChild = TRUE; |
388 BOOL waitForChild = TRUE; |
389 char* fixpathPath; |
389 char* fixpathPath; |
390 |
390 |
391 debug_fixpath = (getenv("DEBUG_FIXPATH") != NULL); |
391 debug_fixpath = (getenv("DEBUG_FIXPATH") != NULL); |
392 |
392 |
393 if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm' && argv[1][1] != 'w')) { |
393 if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm' && argv[1][1] != 'w')) { |
394 fprintf(stderr, "Usage: fixpath -c|m|w<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n"); |
394 fprintf(stderr, "Usage: fixpath -c|m|w<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n"); |
395 exit(0); |
395 exit(0); |
396 } |
396 } |
409 if (debug_fixpath) { |
409 if (debug_fixpath) { |
410 fprintf(stderr, "fixpath using msys mode, with path list: %s\n", &argv[1][2]); |
410 fprintf(stderr, "fixpath using msys mode, with path list: %s\n", &argv[1][2]); |
411 } |
411 } |
412 setup_msys_path_list(argv[1]); |
412 setup_msys_path_list(argv[1]); |
413 replace_cygdrive = replace_cygdrive_msys; |
413 replace_cygdrive = replace_cygdrive_msys; |
414 } else if (argv[1][1] == 'w') { |
414 } else if (argv[1][1] == 'w') { |
415 if (debug_fixpath) { |
415 if (debug_fixpath) { |
416 fprintf(stderr, "fixpath using wsl mode, with path list: %s\n", &argv[1][2]); |
416 fprintf(stderr, "fixpath using wsl mode, with path list: %s\n", &argv[1][2]); |
417 } |
417 } |
418 replace_cygdrive = replace_cygdrive_wsl; |
418 replace_cygdrive = replace_cygdrive_wsl; |
419 } else { |
419 } else { |
515 if (debug_fixpath) { |
515 if (debug_fixpath) { |
516 fprintf(stderr, "fixpath converted line >%s<\n", line); |
516 fprintf(stderr, "fixpath converted line >%s<\n", line); |
517 } |
517 } |
518 |
518 |
519 if (cmd == argc) { |
519 if (cmd == argc) { |
520 if (debug_fixpath) { |
520 if (debug_fixpath) { |
521 fprintf(stderr, "fixpath no command provided!\n"); |
521 fprintf(stderr, "fixpath no command provided!\n"); |
522 } |
522 } |
523 exit(0); |
523 exit(0); |
524 } |
524 } |
525 |
525 |
526 ZeroMemory(&si, sizeof(si)); |
526 ZeroMemory(&si, sizeof(si)); |
527 si.cb=sizeof(si); |
527 si.cb=sizeof(si); |
528 ZeroMemory(&pi, sizeof(pi)); |
528 ZeroMemory(&pi, sizeof(pi)); |
529 |
529 |
530 fflush(stderr); |
530 fflush(stderr); |
531 fflush(stdout); |
531 fflush(stdout); |
532 |
532 |
533 fixpathPath = calloc(32767, sizeof(char)); |
533 fixpathPath = calloc(32767, sizeof(char)); |
534 rc = GetEnvironmentVariable("FIXPATH_PATH", fixpathPath, 32767); |
534 rc = GetEnvironmentVariable("FIXPATH_PATH", fixpathPath, 32767); |
535 if (rc) { |
535 if (rc) { |
536 if (debug_fixpath) { |
536 if (debug_fixpath) { |
537 fprintf(stderr, "Setting Path to FIXPATH_PATH: %s\n", fixpathPath); |
537 fprintf(stderr, "Setting Path to FIXPATH_PATH: %s\n", fixpathPath); |
538 } |
538 } |