Skip to content

Commit

Permalink
app-misc/fdupes: remove stdin as lvalue, bug #574610
Browse files Browse the repository at this point in the history
Package-Manager: portage-2.2.26
  • Loading branch information
blueness committed Feb 29, 2016
1 parent 6b3f131 commit 270f6af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app-misc/fdupes/fdupes-1.51.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

Expand Down Expand Up @@ -26,7 +26,8 @@ src_prepare() {
epatch \
"${FILESDIR}"/${P}-makefile.patch \
"${FILESDIR}"/${PN}-1.50_pre2-compare-file.patch \
"${FILESDIR}"/${PN}-1.50_pre2-typo.patch
"${FILESDIR}"/${PN}-1.50_pre2-typo.patch \
"${FILESDIR}"/${P}-fix-stdin-lvalue.patch

append-lfs-flags
}
Expand Down
20 changes: 20 additions & 0 deletions app-misc/fdupes/files/fdupes-1.51-fix-stdin-lvalue.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This is a combination of upstream's fe2d8334 and 03abad. See
https://bugs.gentoo.org/show_bug.cgi?id=574610.

diff -Naur fdupes-1.51.orig/fdupes.c fdupes-1.51/fdupes.c
--- fdupes-1.51.orig/fdupes.c 2013-04-20 14:02:18.000000000 -0400
+++ fdupes-1.51/fdupes.c 2016-02-29 02:45:36.360804360 -0500
@@ -1164,7 +1164,12 @@
}
else
{
- stdin = freopen("/dev/tty", "r", stdin);
+ if (freopen("/dev/tty", "r", stdin) == 0)
+ {
+ errormsg("could not open terminal for input\n");
+ exit(1);
+ }
+
deletefiles(files, 1, stdin);
}
}

0 comments on commit 270f6af

Please sign in to comment.