| 629 | |
| 630 | #ifdef HOST_CYGWIN |
| 631 | static bool dequote_path(const char *winpath) |
| 632 | { |
| 633 | char *dest = g_dequoted; |
| 634 | const char *src = winpath; |
| 635 | int len = 0; |
| 636 | bool quoted = false; |
| 637 | |
| 638 | while (*src && len < MAX_PATH) |
| 639 | { |
| 640 | if (*src != '\\' || (src[1] != ' ' && src[1] != '(' && src[1] != ')')) |
| 641 | { |
| 642 | *dest++ = *src; |
| 643 | len++; |
| 644 | } |
| 645 | else |
| 646 | { |
| 647 | quoted = true; |
| 648 | } |
| 649 | |
| 650 | src++; |
| 651 | } |
| 652 | |
| 653 | if (*src || len >= MAX_PATH) |
| 654 | { |
| 655 | fprintf(stderr, "# ERROR: Path truncated\n"); |
| 656 | exit(EXIT_FAILURE); |
| 657 | } |
| 658 | |
| 659 | *dest = '\0'; |
| 660 | return quoted; |
| 661 | } |
| 662 | #endif |
| 663 | |
| 664 | static const char *convert_path(const char *path) |
no test coverage detected