| 96 | } |
| 97 | |
| 98 | static bool dequote_path(const char *winpath) |
| 99 | { |
| 100 | char *dest = g_dequoted; |
| 101 | const char *src = winpath; |
| 102 | int len = 0; |
| 103 | bool quoted = false; |
| 104 | |
| 105 | while (*src && len < MAX_PATH) |
| 106 | { |
| 107 | if (src[0] != '\\' || (src[1] != ' ' && |
| 108 | src[1] != '(' && src[1] != ')')) |
| 109 | { |
| 110 | *dest++ = *src; |
| 111 | len++; |
| 112 | } |
| 113 | else |
| 114 | { |
| 115 | quoted = true; |
| 116 | } |
| 117 | |
| 118 | src++; |
| 119 | } |
| 120 | |
| 121 | if (*src || len >= MAX_PATH) |
| 122 | { |
| 123 | fprintf(stderr, "%lu: Line truncated\n", g_lineno); |
| 124 | exit(EXIT_FAILURE); |
| 125 | } |
| 126 | |
| 127 | *dest = '\0'; |
| 128 | return quoted; |
| 129 | } |
| 130 | |
| 131 | static bool convert_path(const char *winpath) |
| 132 | { |
no test coverage detected