This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
This seems to be the right thing to do to iterate over layers
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 16 May 2005 08:58:40 +0000 (08:58 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 16 May 2005 08:58:40 +0000 (08:58 +0000)
p4raw-id: //depot/perl@24476

ext/PerlIO/via/via.xs

index fffa689..36394dd 100644 (file)
@@ -247,7 +247,7 @@ PerlIOVia_open(pTHX_ PerlIO_funcs * self, PerlIO_list_t * layers,
        else {
            /* Required open method not present */
            PerlIO_funcs *tab = NULL;
-           const IV m = n - 1;
+           IV m = n - 1;
            while (m >= 0) {
                PerlIO_funcs *t =
                    PerlIO_layer_fetch(aTHX_ layers, m, NULL);
@@ -255,7 +255,7 @@ PerlIOVia_open(pTHX_ PerlIO_funcs * self, PerlIO_list_t * layers,
                    tab = t;
                    break;
                }
-               n--;
+               m--;
            }
            if (tab) {
                if ((*tab->Open) (aTHX_ tab, layers, m, mode, fd, imode,