shithub: patches

ref: 4ac3a0224ed9d54818f858fba69c8e94f38f2c12
dir: /9front/7637f8f5fd6490d07ba64bcf404321028e698ed9.patch/

View raw version
From: Romano <[email protected]>
Date: Thu, 11 Jul 2024 05:56:24 +0000
Subject: [PATCH] make "" use a fn that will then work with built-ins

	currently "" does not work with built-ins, so re-running
	built-ins might not have the desired effect (e.g., setting
	environment variables, cd). This updates "" to be defined
	internally as a function, which then update the parent
	environment after being called.
---
diff 23b40c5aa93bb205423c8c40d02eef825011b215 7637f8f5fd6490d07ba64bcf404321028e698ed9
--- a/rc/bin/""
+++ b/rc/bin/""
@@ -1,5 +1,5 @@
-#!/bin/rc
-
+#!/bin/rc -b
+fn "" {
 PROMPT='[^ 	]*(%|;)+[ 	]+'
 
 _x = `{" $* | tail -1}
@@ -10,4 +10,6 @@
 
 echo '	' $_x >[1=2]
 _x=`{ echo -n 'eval '''; echo $_x | sed 's/^'$PROMPT'//; s/''/''''/g; s/$/''/'}
-rc -c $"_x
+eval $"_x
+}
+"" $*