This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In S_validate_suid(), move declarations after the first statement.
authorNicholas Clark <nick@ccl4.org>
Sun, 19 Feb 2012 08:38:52 +0000 (09:38 +0100)
committerNicholas Clark <nick@ccl4.org>
Sun, 19 Feb 2012 08:38:52 +0000 (09:38 +0100)
Otherwise exacting C89 compilers refuse to build the code. And at least
one Win32 compiler is exacting on this.

perl.c

diff --git a/perl.c b/perl.c
index b238d04..5518675 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3752,13 +3752,13 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch,
 STATIC void
 S_validate_suid(pTHX_ PerlIO *rsfp)
 {
-    PERL_ARGS_ASSERT_VALIDATE_SUID;
-
     const UV  my_uid = PerlProc_getuid();
     const UV my_euid = PerlProc_geteuid();
     const UV  my_gid = PerlProc_getgid();
     const UV my_egid = PerlProc_getegid();
 
+    PERL_ARGS_ASSERT_VALIDATE_SUID;
+
     if (my_euid != my_uid || my_egid != my_gid) {      /* (suidperl doesn't exist, in fact) */
        dVAR;