Pranit Bauva [off-list ref] writes:
+static char *bisect_voc(char *revision_type)
+{
+ if (!strcmp(revision_type, "bad"))
+ return "bad|new";
+ if (!strcmp(revision_type, "good"))
+ return "good|old";
+
+ return NULL;
+}
I think you can return "const char *" from the above function. Then
you do not have to do xstrdup() on the return values to store in
bad_syn and good_syn, and you do not have to free(3) them.
+static int bisect_next_check(const struct bisect_terms *terms,
+ const char *current_term)
+{
+ ....
+ fprintf(stderr, N_("Warning: bisecting only with a %s commit\n"),
+ terms->term_bad.buf);
Hmph, is this N_() and not _()?
+ ....
+ }
+ bad_syn = xstrdup(bisect_voc("bad"));
+ good_syn = xstrdup(bisect_voc("good"));
+ ....
+ free(bad_syn);
+ free(good_syn);