Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions external/libucl/src/ucl_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,26 @@ ucl_maybe_parse_boolean(ucl_object_t *obj, const unsigned char *start, size_t le
val = true;
}
}
else if (len == 1) {
switch (p[0]) {
case '0':
case 'F':
case 'f':
case 'N':
case 'n':
ret = true;
val = false;
break;
case '1':
case 'T':
case 't':
case 'Y':
case 'y':
ret = true;
val = true;
break;
}
}

if (ret && obj != NULL) {
obj->type = UCL_BOOLEAN;
Expand Down
7 changes: 1 addition & 6 deletions libpkg/pkg_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,12 +1455,7 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
break;
case UCL_BOOLEAN:
o = ucl_object_fromstring_common(val, 0,
UCL_STRING_PARSE_BOOLEAN|UCL_STRING_PARSE_INT);
if (o->type == UCL_INT) {
bool bval = ucl_object_toint(o) != 0;
ucl_object_unref(o);
o = ucl_object_frombool(bval);
}
UCL_STRING_PARSE_BOOLEAN);
if (o->type != UCL_BOOLEAN) {
pkg_emit_error("Invalid type for environment "
"variable %s, got %s, while expecting a boolean",
Expand Down
Loading