shithub: mc

Download patch

ref: dc44267bd3418e713d4b0a51d441129b1119b366
parent: 2f319b2408075aa5165cbc8201bca4ec8a5a58b2
author: Ori Bernstein <[email protected]>
date: Fri Dec 20 08:14:17 EST 2013

Evaluate patterns in their block's scope.

--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -206,7 +206,10 @@
                 fixup(n->matchstmt.matches[i]);
             break;
         case Nmatch:
+            /* patterns are evaluated in their block's scope */
+            pushstab(n->match.block->block.scope);
             fixup(n->match.pat);
+            popstab();
             fixup(n->match.block);
             break;
         case Nblock: