| 308 | } |
| 309 | |
| 310 | bool plugin_paths_match(const char *cmd, const char *name) |
| 311 | { |
| 312 | if (strchr(name, PATH_SEP)) { |
| 313 | const char *cmd_canon, *name_canon; |
| 314 | |
| 315 | if (streq(cmd, name)) |
| 316 | return true; |
| 317 | |
| 318 | /* These return NULL path doesn't exist */ |
| 319 | cmd_canon = path_canon(tmpctx, cmd); |
| 320 | name_canon = path_canon(tmpctx, name); |
| 321 | return cmd_canon && name_canon && streq(name_canon, cmd_canon); |
| 322 | } else { |
| 323 | /* No path separator means a basename match. */ |
| 324 | const char *base = path_basename(tmpctx, cmd); |
| 325 | |
| 326 | return streq(base, name); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | void plugin_blacklist(struct plugins *plugins, const char *name) |
| 331 | { |
no test coverage detected