core: Apply default options to all new contexts
authorBruno Harbulot <bruno@distributedmatter.net>
Thu, 12 Aug 2021 19:26:12 +0000 (20:26 +0100)
committerTormod Volden <debian.tormod@gmail.com>
Mon, 1 Nov 2021 22:20:59 +0000 (23:20 +0100)
commitf7084fea1107625fe5aeb275a2a4801bed2920d5
tree04af7c71cfb76d08b5757894ea1ac82bf61765cd
parentb88f1441856a9ba481dc40c8c6d0415d8556514a
core: Apply default options to all new contexts

The default options configured with libusb_set_option(NULL, ...)
were only applied when the default context was created, and were
ignored when calling libusb_init() with a non-null context pointer.

Make sure the default options will be applied to all new contexts. This
is important when using LIBUSB_OPTION_NO_DEVICE_DISCOVERY which must
be respected during the context initialization in order to work.

Closes #942

[Tormod: amend comments]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
libusb/core.c
libusb/version_nano.h