[please CC me, as I'm not subscribed] I'm not sure to which list I should send this patch, so I reply both to Philipp's message on bug-findutils and on patches. Sorry. ;-)
OpenSuSE-12.2 is still using --without-fts, so the default find program doesn't work with -inum there. BTW: Why is the latest version on ftp.gnu.org still 4.4.2 (3.5 years old) while distros already use newer versions? Have a nice day, Berny >From 3a1f9a36a32814448891f4b3e82d358336afadb9 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker <[email protected]> Date: Mon, 12 Nov 2012 19:29:45 +0100 Subject: [PATCH] Fix -inum option in non-FTS find The call 'find . -inum N' did not work because the stat buffer in process_path is unitialized. As a result, get_info() did not set todo = true and failed to get the stat info for the current pathname. The subsequent comparison in pred_inum therefore used a random value on the stack to compare with. http://savannah.gnu.org/bugs/?37683 * find/find.c (process_path): Initialize stat_buf. Reported-by: Philipp Thomas --- find/find.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/find/find.c b/find/find.c index 93fbbcd..43e0537 100644 --- a/find/find.c +++ b/find/find.c @@ -1169,6 +1169,8 @@ process_path (char *pathname, char *name, bool leaf, char *parent, int i; struct predicate *eval_tree; + memset (&stat_buf, 0, sizeof (stat_buf)); + eval_tree = get_eval_tree (); /* Assume it is a non-directory initially. */ stat_buf.st_mode = 0; -- 1.7.7
