core: Minor code cleanup in libusb_init (NOP)
After commit f7084fe the if clause would always be true, so remove it.
Thanks to "xloem" for reporting.
References #942
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
diff --git a/libusb/core.c b/libusb/core.c
index 03acdd8..7976e4c 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -2319,16 +2319,14 @@
list_init(&_ctx->usb_devs);
list_init(&_ctx->open_devs);
- /* apply options to new contexts (also default context being created) */
- if (ctx || !usbi_default_context) {
- for (enum libusb_option option = 0 ; option < LIBUSB_OPTION_MAX ; option++) {
- if (LIBUSB_OPTION_LOG_LEVEL == option || !default_context_options[option].is_set) {
- continue;
- }
- r = libusb_set_option(_ctx, option);
- if (LIBUSB_SUCCESS != r)
- goto err_free_ctx;
+ /* apply default options to all new contexts */
+ for (enum libusb_option option = 0 ; option < LIBUSB_OPTION_MAX ; option++) {
+ if (LIBUSB_OPTION_LOG_LEVEL == option || !default_context_options[option].is_set) {
+ continue;
}
+ r = libusb_set_option(_ctx, option);
+ if (LIBUSB_SUCCESS != r)
+ goto err_free_ctx;
}
/* default context must be initialized before calling usbi_dbg */
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 09d6e2e..ee61cdd 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11674
+#define LIBUSB_NANO 11675