From 8af96b0aba4c97eebf8ec0b1ac68078e24f5180a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Mon, 15 Sep 1997 17:30:15 -0700 Subject: [PATCH] did some fixes to make replace_master easier Rev: lib/master.pike:1.50 --- lib/master.pike | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/master.pike b/lib/master.pike index 4a5c18b4d2..cffb984abc 100644 --- a/lib/master.pike +++ b/lib/master.pike @@ -1,4 +1,4 @@ -/* $Id: master.pike,v 1.49 1997/09/09 03:40:28 hubbe Exp $ +/* $Id: master.pike,v 1.50 1997/09/16 00:30:15 hubbe Exp $ * * Master-file for Pike. */ @@ -253,18 +253,22 @@ object cast_to_object(string oname, string current_file) class dirnode { string dirname; + object tm; mapping cache=([]); - void create(string name) { dirname=name; } + void create(string name, object the_master) + { + dirname=name; + tm=the_master; + } object|program ind(string index) { - object m=((object)"/master"); - if(mixed o=m->findmodule(dirname+"/module")) + if(mixed o=tm->findmodule(dirname+"/module")) { if(mixed tmp=o->_module_value) o=tmp; if(o=o[index]) return o; } index = dirname+"/"+index; - if(object o=((object)"/master")->findmodule(index)) + if(object o=tm->findmodule(index)) { if(mixed tmp=o->_module_value) o=tmp; return o; @@ -298,7 +302,7 @@ object findmodule(string fullname) if(mixed *stat=file_stat(fullname+".pmod")) { if(stat[1]==-2) - return fc[fullname]=dirnode(fullname+".pmod"); + return fc[fullname]=dirnode(fullname+".pmod",this_object()); } if(o=low_cast_to_object(fullname+".pmod","/.")) -- GitLab