Skip to content

Commit

Permalink
Fix mistake in hints_bridge, thanks yallop!!
Browse files Browse the repository at this point in the history
  • Loading branch information
fxfactorial committed Oct 26, 2016
1 parent 502250a commit 3b53763
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/linenoise_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ static void completion_bridge(const char *buf, linenoiseCompletions *lc)

static char *hints_bridge(const char *buf, int *color, int *bold)
{
CAMLparam0();
CAMLlocal1(cb_result);
cb_result = caml_callback(hints_cb, caml_copy_string(buf));
if (cb_result == Val_none) {
return NULL;
CAMLreturnT(char *,NULL);
} else {
const char *msg = caml_strdup(String_val(Field(Field(cb_result, 0), 0)));
char *msg = caml_strdup(String_val(Field(Field(cb_result, 0), 0)));
*color = Int_val(Field(Field(cb_result, 0), 1)) + 31;
*bold = Bool_val(Field(Field(cb_result, 0), 2));
return (char *)msg;
CAMLreturnT(char *,msg);
}
}

Expand Down

0 comments on commit 3b53763

Please sign in to comment.