[libmtp] Fix inverted boolean logic, mea culpa

Linus Walleij snirkel at fedoraproject.org
Mon Jan 24 18:33:58 UTC 2011


commit 51268617c18c53e4f122171a9999c9fe55a69e8a
Author: Linus Walleij <linus.walleij at stericsson.com>
Date:   Mon Jan 24 19:33:42 2011 +0100

    Fix inverted boolean logic, mea culpa

 0001-Fix-inverted-boolean-logic.patch |   29 +++++++++++++++++++++++++++++
 libmtp.spec                           |    7 ++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/0001-Fix-inverted-boolean-logic.patch b/0001-Fix-inverted-boolean-logic.patch
new file mode 100644
index 0000000..85c36bd
--- /dev/null
+++ b/0001-Fix-inverted-boolean-logic.patch
@@ -0,0 +1,29 @@
+From 3230d1d0f2afbae4145f11437f623d1611d855a2 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <triad at df.lth.se>
+Date: Mon, 24 Jan 2011 19:31:25 +0100
+Subject: [PATCH] Fix inverted boolean logic...
+
+---
+ src/libusb-glue.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/libusb-glue.c b/src/libusb-glue.c
+index ca8c47d..a702eed 100644
+--- a/src/libusb-glue.c
++++ b/src/libusb-glue.c
+@@ -237,9 +237,9 @@ static int probe_device_descriptor(struct usb_device *dev, FILE *dumpfile)
+    * contain any MTP interface, update this the day
+    * you find some weird combination...
+    */
+-  if (dev->descriptor.bDeviceClass != USB_CLASS_PER_INTERFACE &&
+-      dev->descriptor.bDeviceClass != USB_CLASS_COMM &&
+-      dev->descriptor.bDeviceClass != USB_CLASS_PTP &&
++  if (dev->descriptor.bDeviceClass != USB_CLASS_PER_INTERFACE ||
++      dev->descriptor.bDeviceClass != USB_CLASS_COMM ||
++      dev->descriptor.bDeviceClass != USB_CLASS_PTP ||
+       dev->descriptor.bDeviceClass != USB_CLASS_VENDOR_SPEC) {
+     return 0;
+   }
+-- 
+1.7.3.4
+
diff --git a/libmtp.spec b/libmtp.spec
index d5dd4d1..871d4b1 100644
--- a/libmtp.spec
+++ b/libmtp.spec
@@ -3,13 +3,14 @@
 
 Name:           libmtp
 Version:        1.0.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A software library for MTP media players
 URL:            http://libmtp.sourceforge.net/
 
 Group:          System Environment/Libraries
 Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 Patch0:		0001-Fixup-device-OS-descriptor-probe-code.patch
+Patch1:		0001-Fix-inverted-boolean-logic.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 License:        LGPLv2+
 Requires:       udev
@@ -53,6 +54,7 @@ library for MTP media players.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure --disable-static
@@ -128,6 +130,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Jan 24 2011 Linus Walleij <triad at df.lth.se> 1.0.4-3
+- Screwed up boolean logic in last patch, fixing it.
+
 * Wed Jan 19 2011 Linus Walleij <triad at df.lth.se> 1.0.4-2
 - Testing out a patch to be more careful when probing devices.
 


More information about the scm-commits mailing list