From 6cd5d3b1a82f2dd72fe6bbc6bc280809beef4c29 Mon Sep 17 00:00:00 2001
From: James Youngman <jay@gnu.org>
Date: Sat, 21 Sep 2013 23:45:08 +0100
Subject: [PATCH] find: state that -execdir command is run locally to the
 matched file.
To: findutils-patches@gnu.org

* doc/find.texi (Single File): Correct the description of what the
current directory will be when the command specified by -execdir
gets run.  This fixes a documentation but reported by Eric
Hanchrow.
* NEWS: Mention this fix.
---
 ChangeLog     |    9 +++++++++
 NEWS          |    6 ++++++
 doc/find.texi |    5 +++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 076c0d4..ec474c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-09-21  James Youngman  <jay@gnu.org>
+
+	find: state that -execdir command is run locally to the matched file.
+	* doc/find.texi (Single File): Correct the description of what the
+	current directory will be when the command specified by -execdir
+	gets run.  This fixes a documentation but reported by Eric
+	Hanchrow.
+	* NEWS: Mention this fix.
+
 2013-09-21  Bernhard Voelker  <mail@bernhard-voelker.de>
 
 	xargs: wait for process before prompting in interactive mode (-p)
diff --git a/NEWS b/NEWS
index a08ec91..9202acc 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,12 @@ clarity.
 The documentation for xargs now warns about parallel processes (xargs
 -P) sharing stdout.
 
+The documentation for find -execdir now describes correctly that the
+command will be executed in the same directory as the file we were
+considering at the time.  The documentation previously (and
+incorrectly) stated that the original working directory of find would
+be used.
+
 ** Bug Fixes
 
 Some bugs in 4.5.11 were fixed without adding them to the bug
diff --git a/doc/find.texi b/doc/find.texi
index 94d4c5c..f913965 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -2117,8 +2117,9 @@ an argument consisting of @samp{;} is reached.  It replaces the string
 @samp{@{@}} by the current file name being processed everywhere it
 occurs in the command.  Both of these constructions need to be escaped
 (with a @samp{\}) or quoted to protect them from expansion by the
-shell.  The command is executed in the directory in which @code{find}
-was run.
+shell.  The command is executed in the directory which @code{find}
+was searching at the time the action was executed (that is, @{@} will
+expand to a file in the local directory).
 
 For example, to compare each C header file in or below the current
 directory with the file @file{/tmp/master}:
-- 
1.7.10.4

