summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2009-02-15 16:49:35 +0100
committerJames Youngman <jay@gnu.org>2009-04-10 23:44:48 +0100
commitf511840646b9e21deffb4b79a63d8f4ae48315c7 (patch)
tree295c3ef712216b5fb8029839d7dc77c153d926c8
parentf85aecbfcc007050090734fcce53b56dae9b7670 (diff)
downloadfindutils-f511840646b9e21deffb4b79a63d8f4ae48315c7.tar.gz
find: avoid warning about unused local, remove unnecessary include.
* find/pred.c (scan_for_digit_differences): Remove declaration of unused local, "ok". (do_time_format): Remove decl of "done"; replace sole use with a constant, "true". Initialize "i" and "n". * lib/dircallback.c: Don't include unistd.h. Not needed.
-rw-r--r--ChangeLog8
-rw-r--r--find/pred.c5
-rw-r--r--lib/dircallback.c7
3 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 91b00722..291116f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,14 @@
2009-04-10 Jim Meyering <meyering@redhat.com>
Backport a fix from 4.5.x.
+ find: avoid warning about unused local, remove unnecessary include.
+ * find/pred.c (scan_for_digit_differences): Remove declaration of
+ unused local, "ok".
+ (do_time_format): Remove decl of "done"; replace sole use with a
+ constant, "true". Initialize "i" and "n".
+ * lib/dircallback.c: Don't include unistd.h. Not needed.
+
+ Backport a fix from 4.5.x.
* README-CVS: tiny typo fix (s/fileutils/findutils/).
2009-04-10 James Youngman <jay@gnu.org>
diff --git a/find/pred.c b/find/pred.c
index 92da9fc2..b4e04047 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -2070,7 +2070,6 @@ do_time_format (const char *fmt, const struct tm *p, const char *ns, size_t ns_s
static char *buf = NULL;
static size_t buf_size;
char *timefmt = NULL;
- boolean done = false;
struct tm altered_time;
@@ -2098,7 +2097,7 @@ do_time_format (const char *fmt, const struct tm *p, const char *ns, size_t ns_s
*/
buf_size = 1u;
buf = xmalloc (buf_size);
- while (!done)
+ while (true)
{
/* I'm not sure that Solaris will return 0 when the buffer is too small.
* Therefore we do not check for (buf_used != 0) as the termination
@@ -2109,7 +2108,7 @@ do_time_format (const char *fmt, const struct tm *p, const char *ns, size_t ns_s
&& (buf_used < buf_size)) /* Solaris workaround */
{
char *altbuf;
- size_t i, n;
+ size_t i = 0, n = 0;
size_t final_len = (buf_used
+ 1u /* for \0 */
+ ns_size);
diff --git a/lib/dircallback.c b/lib/dircallback.c
index 29fb276c..5dbf3b3b 100644
--- a/lib/dircallback.c
+++ b/lib/dircallback.c
@@ -1,5 +1,5 @@
/* listfile.c -- run a function in a specific directory
- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,11 +32,6 @@
#include "save-cwd.h"
-/* The presence of unistd.h is assumed by gnulib these days, so we
- * might as well assume it too.
- */
-#include <unistd.h> /* for readlink() */
-
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif