| 388 | } |
| 389 | |
| 390 | bool plugin_paths_match(const char *cmd, const char *name) |
| 391 | { |
| 392 | if (strchr(name, PATH_SEP)) { |
| 393 | const char *cmd_canon, *name_canon; |
| 394 | |
| 395 | if (streq(cmd, name)) |
| 396 | return true; |
| 397 | |
| 398 | /* These return NULL path doesn't exist */ |
| 399 | cmd_canon = path_canon(tmpctx, cmd); |
| 400 | name_canon = path_canon(tmpctx, name); |
| 401 | return cmd_canon && name_canon && streq(name_canon, cmd_canon); |
| 402 | } else { |
| 403 | /* No path separator means a basename match. */ |
| 404 | const char *base = path_basename(tmpctx, cmd); |
| 405 | |
| 406 | return streq(base, name); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | void plugin_blacklist(struct plugins *plugins, const char *name) |
| 411 | { |
no test coverage detected