| static const char *alias_key; |
| static int alias_lookup_cb(const char *k, const char *v, void *cb __used) |
| if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) { |
| return config_error_nonbool(k); |
| char *alias_lookup(const char *alias) |
| perf_config(alias_lookup_cb, NULL); |
| int split_cmdline(char *cmdline, const char ***argv) |
| int src, dst, count = 0, size = 16; |
| *argv = malloc(sizeof(char*) * size); |
| (*argv)[count++] = cmdline; |
| for (src = dst = 0; cmdline[src];) { |
| if (!quoted && isspace(c)) { |
| && isspace(cmdline[src])) |
| *argv = realloc(*argv, sizeof(char*) * size); |
| (*argv)[count++] = cmdline + dst; |
| } else if (!quoted && (c == '\'' || c == '"')) { |
| } else if (c == quoted) { |
| if (c == '\\' && quoted != '\'') { |
| return error("cmdline ends with \\"); |
| return error("unclosed quote"); |