about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch')
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch b/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch
new file mode 100644
index 000000000000..2b0587510bc0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch
@@ -0,0 +1,18 @@
+gcc-7 newly detects this class of bugs.
+In this particular case it's clear that the inention was
+to detect if the string is non-NULL *and* non-empty.
+
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..66a7226 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -176,7 +176,7 @@ set_startup_id (UniqueBackend *backend,
+ {
+   gchar *id;
+ 
+-  if (startup_id && startup_id != '\0')
++  if (startup_id && *startup_id != '\0')
+     id = g_strdup (startup_id);
+   else
+     {