pkgsrc/sysutils/fdupes/patches/patch-aa
kamil 219e1ccba9 Update sysutils/fdupes to 1.51
Patch via pkgsrc-wip/fdupes by Mateusz Poszwa

Changes from 1.50 to 1.51

- Added support for 64-bit file offsets on 32-bit systems.
- Using tty for interactive input instead of regular stdin. This is to
  allow  feeding filenames via stdin in future versions of fdupes without
  breaking interactive deletion feature.
- Fixed some typos in --help.
- Turned C++ style comments into C style comments.

Changes from 1.40 to 1.50-PR2

- Fixed memory leak. [JB]
- Added "--summarize" option. [AL]
- Added "--recurse:" selective recursion option. [AL]
- Added "--noprompt" option for totally automated deletion of
  duplicate files.
- Now sorts duplicates (old to new) for consistent order when
  listing or deleteing duplicate files.
- Now tests for early matching of files, which should help speed up
  the matching process when large files are involved.
- Added warning whenever a file cannot be deleted. [CHL, AL]
- Fixed bug where some files would not be closed after failure. [AL]
- Fixed bug where confirmmatch() function wouldn't always deal
  properly with zero-length files. [AL]
- Fixed bug where progress indicator would not be cleared
  when no files were found. [AL]
- Removed experimental red-black tree code (it was slower on
  my system than the default code). [AL]
- Modified md5/md5.c to avoid compiler warning. [CHL]
- Changes to fdupes.c for compilation under platforms where
  getopt_long is unavailable. [LR, AL]
- Changes to help text for clarity. [AL]
- Various changes and improvements to Makefile. [PB, AL]
2015-12-12 04:00:30 +00:00

37 lines
1.3 KiB
Text

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