Converge the implementation of tied OPEN with PRINTF, READ and WRITE.
authorNicholas Clark <nick@ccl4.org>
Tue, 4 Jan 2011 09:48:27 +0000 (09:48 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 4 Jan 2011 10:30:27 +0000 (10:30 +0000)
Consistency will make it easier to refactor.

pp_sys.c

index 262fefe..cf6263a 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -536,8 +536,8 @@ PP(pp_open)
        if (mg) {
            /* Method's args are same as ours ... */
            /* ... except handle is replaced by the object */
-           *MARK-- = SvTIED_obj(MUTABLE_SV(io), mg);
-           PUSHMARK(MARK);
+           PUSHMARK(MARK - 1);
+           *MARK = SvTIED_obj(MUTABLE_SV(io), mg);
            PUTBACK;
            ENTER_with_name("call_OPEN");
            call_method("OPEN", G_SCALAR);