2015-12-12 05:00:30 +01:00
|
|
|
$NetBSD: patch-aa,v 1.2 2015/12/12 04:00:30 kamil Exp $
|
2008-12-17 12:56:26 +01:00
|
|
|
|
2015-12-12 05:00:30 +01:00
|
|
|
Add casts to silence printf errors.
|
|
|
|
Do not overwrite stdin.
|
|
|
|
|
|
|
|
--- fdupes.c.orig 2013-04-20 18:02:18.000000000 +0000
|
2008-12-17 12:56:26 +01:00
|
|
|
+++ fdupes.c
|
2015-12-12 05:00:30 +01:00
|
|
|
@@ -643,7 +643,7 @@ void printmatches(file_t *files)
|
2008-12-17 12:56:26 +01:00
|
|
|
while (files != NULL) {
|
|
|
|
if (files->hasdupes) {
|
|
|
|
if (!ISFLAG(flags, F_OMITFIRST)) {
|
2015-12-12 05:00:30 +01:00
|
|
|
- if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", files->size,
|
|
|
|
+ if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", (long long)files->size,
|
2008-12-17 12:56:26 +01:00
|
|
|
(files->size != 1) ? "s " : " ");
|
|
|
|
if (ISFLAG(flags, F_DSAMELINE)) escapefilename("\\ ", &files->d_name);
|
|
|
|
printf("%s%c", files->d_name, ISFLAG(flags, F_DSAMELINE)?' ':'\n');
|
2015-12-12 05:00:30 +01:00
|
|
|
@@ -796,7 +796,7 @@ void deletefiles(file_t *files, int prom
|
2008-12-17 12:56:26 +01:00
|
|
|
do {
|
|
|
|
printf("Set %d of %d, preserve files [1 - %d, all]",
|
|
|
|
curgroup, groups, counter);
|
2015-12-12 05:00:30 +01:00
|
|
|
- if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", files->size,
|
|
|
|
+ if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", (long long)files->size,
|
2008-12-17 12:56:26 +01:00
|
|
|
(files->size != 1) ? "s " : " ");
|
|
|
|
printf(": ");
|
|
|
|
fflush(stdout);
|
2015-12-12 05:00:30 +01:00
|
|
|
@@ -1164,8 +1164,9 @@ int main(int argc, char **argv) {
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
- stdin = freopen("/dev/tty", "r", stdin);
|
|
|
|
- deletefiles(files, 1, stdin);
|
|
|
|
+ FILE* fd;
|
|
|
|
+ fd = freopen("/dev/tty", "r", stdin);
|
|
|
|
+ deletefiles(files, 1, fd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|