Length of the callee's head (before its first separator) and the * separator's offset, or 0 when the callee has none. */
| 393 | /* Length of the callee's head (before its first separator) and the |
| 394 | * separator's offset, or 0 when the callee has none. */ |
| 395 | static size_t spawn_head_len(const char *callee) { |
| 396 | size_t best = 0; |
| 397 | for (int i = 0; spawn_separators[i]; i++) { |
| 398 | const char *at = strstr(callee, spawn_separators[i]); |
| 399 | if (at && at > callee && (best == 0 || (size_t)(at - callee) < best)) { |
| 400 | best = (size_t)(at - callee); |
| 401 | } |
| 402 | } |
| 403 | return best; |
| 404 | } |
| 405 | |
| 406 | /* True when `val` names `name` as its last segment ("subprocess.run" for |
| 407 | * run, "java.lang.ProcessBuilder" for ProcessBuilder). */ |