about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-06-15 13:07:50 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-06-15 13:07:50 +0000
commit3f6a9e4522205efb2e404d81ae44ad45df44d79b (patch)
tree2d440db6a38d8137bc04c6d64ee4159257a63f63
parent12e1cf567d239495cf238f44456ab19daab327c8 (diff)
downloadzsh-3f6a9e4522205efb2e404d81ae44ad45df44d79b.tar.gz
zsh-3f6a9e4522205efb2e404d81ae44ad45df44d79b.tar.xz
zsh-3f6a9e4522205efb2e404d81ae44ad45df44d79b.zip
fix setting of individual positional parameters after 14915
-rw-r--r--ChangeLog9
-rw-r--r--Src/params.c21
2 files changed, 24 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b9b87b15..a065aadcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-15  Peter Stephenson  <pws@csr.com>
+
+	* 14929: Src/params.c: after 14915, assigning to individual
+	positional parameters failed.
+
 2001-06-15  Andrej Borsenkow  <bor@zsh.org>
 
 	* 14931: Src/Modules/tcp.c, Src/Modules/zftp.c: fix length
@@ -5,6 +10,10 @@
 
 2001-06-14  Peter Stephenson  <pws@csr.com>
 
+	* 14921: Functions/Zftp/zfinit, Completion/Zsh/Command/_zftp:
+	Load tcp module for zftp; autoload zfget_match and zfcd_match
+	for _zftp.
+
 	* 14915: Doc/Zsh/builtins.yo, Doc/Zsh/Params.yo, Src/builtin.c,
 	Src/params.c: special parameters can't have readonly turned off;
 	$* and $@ are readonly.
diff --git a/Src/params.c b/Src/params.c
index 7eec34bf4..f96824165 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -108,13 +108,12 @@ mod_export int termflags;
  
 /* Nodes for special parameters for parameter hash table */
 
-static
 #ifdef HAVE_UNION_INIT
 # define BR(X) {X}
-struct param
+typedef struct param initparam;
 #else
 # define BR(X) X
-struct iparam {
+typedef struct iparam {
     struct hashnode *next;
     char *nam;			/* hash data                             */
     int flags;			/* PM_* flags (defined in zsh.h)         */
@@ -127,9 +126,10 @@ struct iparam {
     char *ename;		/* name of corresponding environment var */
     Param old;			/* old struct for use with local         */
     int level;			/* if (old != NULL), level of localness  */
-}
+} initparam;
 #endif
-special_params[] ={
+
+static initparam special_params[] ={
 #define SFN(X) BR(((void (*)_((Param, char *)))(X)))
 #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}
@@ -248,6 +248,15 @@ IPDEF10("pipestatus", pipestatgetfn, pipestatsetfn),
 
 {NULL, NULL}
 };
+
+/*
+ * Special way of referring to the positional parameters.  Unlike $*
+ * and $@, this is not readonly.  This parameter is not directly
+ * visible in user space.
+ */
+initparam argvparam_pm = IPDEF9F("", &pparams, NULL, \
+				 PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT);
+
 #undef BR
 
 #define IS_UNSET_VALUE(V) \
@@ -502,7 +511,7 @@ createparamtable(void)
 	while ((++ip)->nam)
 	    paramtab->addnode(paramtab, ztrdup(ip->nam), ip);
 
-    argvparam = (Param) paramtab->getnode(paramtab, "*");
+    argvparam = (Param) &argvparam_pm;
 
     noerrs = 2;