| 27 | } |
| 28 | |
| 29 | const char *strvec_pushf(struct strvec *array, const char *fmt, ...) |
| 30 | { |
| 31 | va_list ap; |
| 32 | struct strbuf v = STRBUF_INIT; |
| 33 | |
| 34 | va_start(ap, fmt); |
| 35 | strbuf_vaddf(&v, fmt, ap); |
| 36 | va_end(ap); |
| 37 | |
| 38 | strvec_push_nodup(array, strbuf_detach(&v, NULL)); |
| 39 | return array->v[array->nr - 1]; |
| 40 | } |
| 41 | |
| 42 | void strvec_pushl(struct strvec *array, ...) |
| 43 | { |