code: purgatorio

Download patch

ref: 15b2a406cc0e11377cee12b5a112c003f7250a7f
parent: 51bf59e016b43f16ec91943829af30d99a886cc1
author: henesy <devnull@localhost>
date: Mon May 31 06:39:45 EDT 2021

sh builtin run now properly expands path if no ./ is supplied

--- a/appl/cmd/sh/sh.b
+++ b/appl/cmd/sh/sh.b
@@ -768,7 +768,9 @@
 		}
 
 		if (!disfile) {
-			fd = sys->open(npath += ".dis", sys->OREAD);
+			npath += ".dis";
+			sys->print("trying ⇒ %s\n", npath);
+			fd = sys->open(npath, sys->OREAD);
 			if(fd != nil){
 				return npath;
 			}
@@ -1940,8 +1942,8 @@
 	ctxt.push();
 	{
 		ctxt.setoptions(ctxt.INTERACTIVE, 0);
-		#path := pathexpand(ctxt, (hd tl args).word);
-		runscript(ctxt, (hd tl args).word, tl tl args, 1);
+		path := pathexpand(ctxt, (hd tl args).word);
+		runscript(ctxt, path, tl tl args, 1);
 		ctxt.pop();
 		return nil;
 	} exception e {