This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge ck_trunc and ck_chdir
authorFather Chrysostomos <sprout@cpan.org>
Thu, 26 Jul 2012 01:00:34 +0000 (18:00 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 26 Jul 2012 01:00:34 +0000 (18:00 -0700)
ck_chdir, added in 2006 (d4ac975e) duplicates ck_trunc, added in
1993 (79072805), except for a null op check which is harmless when
applied to chdir.

embed.h
op.c
opcode.h
proto.h
regen/opcodes

diff --git a/embed.h b/embed.h
index f8be76d..5e9f6eb 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define check_utf8_print(a,b)  Perl_check_utf8_print(aTHX_ a,b)
 #define ck_anoncode(a)         Perl_ck_anoncode(aTHX_ a)
 #define ck_bitop(a)            Perl_ck_bitop(aTHX_ a)
-#define ck_chdir(a)            Perl_ck_chdir(aTHX_ a)
 #define ck_cmp(a)              Perl_ck_cmp(aTHX_ a)
 #define ck_concat(a)           Perl_ck_concat(aTHX_ a)
 #define ck_defined(a)          Perl_ck_defined(aTHX_ a)
diff --git a/op.c b/op.c
index 28fc225..b5ebd79 100644 (file)
--- a/op.c
+++ b/op.c
@@ -10020,23 +10020,6 @@ Perl_ck_svconst(pTHX_ OP *o)
 }
 
 OP *
-Perl_ck_chdir(pTHX_ OP *o)
-{
-    PERL_ARGS_ASSERT_CK_CHDIR;
-    if (o->op_flags & OPf_KIDS) {
-       SVOP * const kid = (SVOP*)cUNOPo->op_first;
-
-       if (kid && kid->op_type == OP_CONST &&
-           (kid->op_private & OPpCONST_BARE))
-       {
-           o->op_flags |= OPf_SPECIAL;
-           kid->op_private &= ~OPpCONST_STRICT;
-       }
-    }
-    return ck_fun(o);
-}
-
-OP *
 Perl_ck_trunc(pTHX_ OP *o)
 {
     PERL_ARGS_ASSERT_CK_TRUNC;
index 2c7db83..10dc22a 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -1596,7 +1596,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
        Perl_ck_ftst,           /* fttty */
        Perl_ck_ftst,           /* fttext */
        Perl_ck_ftst,           /* ftbinary */
-       Perl_ck_chdir,          /* chdir */
+       Perl_ck_trunc,          /* chdir */
        Perl_ck_fun,            /* chown */
        Perl_ck_fun,            /* chroot */
        Perl_ck_fun,            /* unlink */
diff --git a/proto.h b/proto.h
index 2c04468..1930ff3 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -312,12 +312,6 @@ PERL_CALLCONV OP * Perl_ck_bitop(pTHX_ OP *o)
 #define PERL_ARGS_ASSERT_CK_BITOP      \
        assert(o)
 
-PERL_CALLCONV OP *     Perl_ck_chdir(pTHX_ OP *o)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_CK_CHDIR      \
-       assert(o)
-
 PERL_CALLCONV OP *     Perl_ck_cmp(pTHX_ OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
index da2212a..e249407 100644 (file)
@@ -413,7 +413,7 @@ ftbinary    -B                      ck_ftst         isu-    F-
 # File calls.
 
 # chdir really behaves as if it had both "S?" and "F?"
-chdir          chdir                   ck_chdir        isT%    S?
+chdir          chdir                   ck_trunc        isT%    S?
 chown          chown                   ck_fun          imsT@   L
 chroot         chroot                  ck_fun          isTu%   S?
 unlink         unlink                  ck_fun          imsTu@  L