diff options
Diffstat (limited to 'builtin.h')
| -rw-r--r-- | builtin.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -107,6 +107,16 @@ void setup_auto_pager(const char *cmd, int def); int is_builtin(const char *s); +/* + * Builtins which do not use RUN_SETUP should never see + * a prefix that is not empty; use this to protect downstream + * code which is not prepared to call prefix_filename(), etc. + */ +#define BUG_ON_NON_EMPTY_PREFIX(prefix) do { \ + if ((prefix)) \ + BUG("unexpected prefix in builtin: %s", (prefix)); \ +} while (0) + int cmd_add(int argc, const char **argv, const char *prefix); int cmd_am(int argc, const char **argv, const char *prefix); int cmd_annotate(int argc, const char **argv, const char *prefix); |
