@@ -125,10 +125,13 @@ func SetConfigDir(dir string) {
125125 if Trace {
126126 fmt .Printf ("Loading %q.\n " , cfgPath )
127127 }
128- pathname := slip .String (filepath .Join (slip .WorkingDir , cfgPath ))
129- code , listProvs := slip .ReadProv (buf , & scope , string (pathname ), nil )
130- _ = slip .CurrentPackage .Set ("*load-pathname*" , pathname )
131- _ = slip .CurrentPackage .Set ("*load-truename*" , pathname )
128+ pathname := cfgPath
129+ if cfgPath [0 ] != '/' {
130+ pathname = filepath .Join (slip .WorkingDir , cfgPath )
131+ }
132+ code , listProvs := slip .ReadProv (buf , & scope , pathname , nil )
133+ _ = slip .CurrentPackage .Set ("*load-pathname*" , slip .String (pathname ))
134+ _ = slip .CurrentPackage .Set ("*load-truename*" , slip .String (pathname ))
132135 code .CompileWithProvenance (listProvs )
133136 code .Eval (& scope , nil ) // TBD consider load-verbose and load-print
134137 } else {
@@ -141,7 +144,10 @@ func SetConfigDir(dir string) {
141144 }
142145 }
143146 if buf , err = os .ReadFile (customPath ); err == nil {
144- pathname := slip .String (filepath .Join (slip .WorkingDir , customPath ))
147+ if customPath [0 ] != '/' {
148+ customPath = filepath .Join (slip .WorkingDir , customPath )
149+ }
150+ pathname := slip .String (customPath )
145151 _ = slip .CurrentPackage .Set ("*load-pathname*" , pathname )
146152 _ = slip .CurrentPackage .Set ("*load-truename*" , pathname )
147153 if Trace {
0 commit comments