about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-08-30 19:00:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-08-30 19:00:20 +0000
commitc016b2dcdc7faade5b279c279b2d506b9ea22bf7 (patch)
tree75d03b9553d531581cec66b46cb3a43a36d23c85
parent34a1ad0a5c0560fbc7c2b0825840945a893fd135 (diff)
downloadzsh-c016b2dcdc7faade5b279c279b2d506b9ea22bf7.tar.gz
zsh-c016b2dcdc7faade5b279c279b2d506b9ea22bf7.tar.xz
zsh-c016b2dcdc7faade5b279c279b2d506b9ea22bf7.zip
18982: comments/rant for paramsubst()
-rw-r--r--ChangeLog2
-rw-r--r--Src/params.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 729054257..ee08cb553 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2003-08-30  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
+	* 18982: Src/subst.c:  Comments/rant for paramsubst().
+
 	* 18981: Doc/Zsh/tcpsys.yo: General tidy up.
 
 2003-08-22  Peter Stephenson  <pws@csr.com>
diff --git a/Src/params.c b/Src/params.c
index 61aa3456a..a4890bcb0 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -137,7 +137,7 @@ static initparam special_params[] ={
 #define GFN(X) BR(((char *(*)_((Param)))(X)))
 #define IPDEF1(A,B,C,D) {NULL,A,PM_INTEGER|PM_SPECIAL|D,BR(NULL),SFN(C),GFN(B),stdunsetfn,10,NULL,NULL,NULL,0}
 IPDEF1("#", poundgetfn, nullintsetfn, PM_READONLY),
-IPDEF1("ERRNO", errnogetfn, nullintsetfn, PM_READONLY),
+IPDEF1("ERRNO", errnogetfn, errnosetfn, 0),
 IPDEF1("GID", gidgetfn, gidsetfn, PM_DONTIMPORT | PM_RESTRICTED),
 IPDEF1("EGID", egidgetfn, egidsetfn, PM_DONTIMPORT | PM_RESTRICTED),
 IPDEF1("HISTSIZE", histsizegetfn, histsizesetfn, PM_RESTRICTED),
@@ -3014,6 +3014,15 @@ savehistsizesetfn(Param pm, zlong v)
 	savehistsiz = 0;
 }
 
+/* Function to set value for special parameter `ERRNO' */
+
+/**/
+void
+errnosetfn(Param pm, zlong x)
+{
+    errno = (int)x;
+}
+
 /* Function to get value for special parameter `ERRNO' */
 
 /**/