This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "Missed one statbuf declaration in 45a23732c73."
authorCraig A. Berry <craigberry@mac.com>
Thu, 15 Oct 2015 14:08:36 +0000 (09:08 -0500)
committerCraig A. Berry <craigberry@mac.com>
Thu, 15 Oct 2015 17:22:43 +0000 (12:22 -0500)
This reverts commit 97466d2cbf895b35ac41b8bf7c31db955b52d48e.

Adding a declaration at function scope causes unused variable
warnings when there are paths that redeclare it at an inner scope.

util.c

diff --git a/util.c b/util.c
index 0800f38..967c9ef 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3245,7 +3245,6 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch,
     I32 len = 0;
     int retval;
     char *bufend;
-    Stat_t statbuf;
 #if defined(DOSISH) && !defined(OS2)
 #  define SEARCH_EXTS ".bat", ".cmd", NULL
 #  define MAX_EXT_LEN 4
@@ -3338,6 +3337,7 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch,
            DEBUG_p(PerlIO_printf(Perl_debug_log,
                                  "Looking for %s\n",cur));
            {
+               Stat_t statbuf;
                if (PerlLIO_stat(cur,&statbuf) >= 0
                    && !S_ISDIR(statbuf.st_mode)) {
                    dosearch = 0;