Skip to content

Commit

Permalink
libunique: fix build with gcc-7 by fixing a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Feb 18, 2018
1 parent e202018 commit 64db4f7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/development/libraries/libunique/default.nix
Expand Up @@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
./1.1.6-fix-test.patch
./1.1.6-G_CONST_RETURN.patch
./1.1.6-include-terminator.patch
];
]
++ [ ./gcc7-bug.patch ];

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib gtk2 dbus_glib ];
Expand All @@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
doCheck = true;

meta = {
homepage = http://live.gnome.org/LibUnique;
homepage = https://wiki.gnome.org/Attic/LibUnique;
description = "A library for writing single instance applications";
license = stdenv.lib.licenses.lgpl21;
platforms = stdenv.lib.platforms.linux;
Expand Down
18 changes: 18 additions & 0 deletions 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
{

0 comments on commit 64db4f7

Please sign in to comment.