summaryrefslogtreecommitdiff
path: root/Src/params.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2016-12-06 21:51:35 +0100
committerAxel Beckert <abe@deuxchevaux.org>2016-12-06 21:51:35 +0100
commite631e433ac7afacf9f756f2bc0dec47fa5930a24 (patch)
tree9d67e40f2c33ad956c063f1356dbd226cf649850 /Src/params.c
parentf6ab748f518e7fa542f3a7bef311c698a45b1fef (diff)
parent9f605904dda106c181717877f29261782fbf243d (diff)
downloadzsh-e631e433ac7afacf9f756f2bc0dec47fa5930a24.tar.gz
zsh-e631e433ac7afacf9f756f2bc0dec47fa5930a24.zip
Merge tag 'zsh-5.2-test-2' into debian
Second test version before 5.3
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/Src/params.c b/Src/params.c
index aa8b196bd..c64d7486b 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1761,6 +1761,18 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
return r;
}
+/*
+ * Parse a subscript.
+ *
+ * pptr: In/Out parameter. On entry, *ptr points to a "[foo]" string. On exit
+ * it will point one past the closing bracket.
+ *
+ * v: In/Out parameter. Its .start and .end members (at least) will be updated
+ * with the parsed indices.
+ *
+ * flags: can be either SCANPM_DQUOTED or zero. Other bits are not used.
+ */
+
/**/
int
getindex(char **pptr, Value v, int flags)
@@ -3245,7 +3257,11 @@ unsetparam(char *s)
unqueue_signals();
}
-/* Unset a parameter */
+/* Unset a parameter
+ *
+ * altflag: if true, don't remove pm->ename from the environment
+ * exp: See stdunsetfn()
+ */
/**/
mod_export int
@@ -4061,7 +4077,7 @@ uidsetfn(UNUSED(Param pm), zlong x)
{
#ifdef HAVE_SETUID
if (setuid((uid_t)x))
- zwarn("failed to change user ID: %e", errno);
+ zerr("failed to change user ID: %e", errno);
#endif
}
@@ -4082,7 +4098,7 @@ euidsetfn(UNUSED(Param pm), zlong x)
{
#ifdef HAVE_SETEUID
if (seteuid((uid_t)x))
- zwarn("failed to change effective user ID: %e", errno);
+ zerr("failed to change effective user ID: %e", errno);
#endif
}
@@ -4103,7 +4119,7 @@ gidsetfn(UNUSED(Param pm), zlong x)
{
#ifdef HAVE_SETUID
if (setgid((gid_t)x))
- zwarn("failed to change group ID: %e", errno);
+ zerr("failed to change group ID: %e", errno);
#endif
}
@@ -4124,7 +4140,7 @@ egidsetfn(UNUSED(Param pm), zlong x)
{
#ifdef HAVE_SETEUID
if (setegid((gid_t)x))
- zwarn("failed to change effective group ID: %e", errno);
+ zerr("failed to change effective group ID: %e", errno);
#endif
}