summary refs log tree commit diff
path: root/src/var.h (follow)
Commit message (Collapse)AuthorAge
* [VAR] Fix loss of variables when hash collidesHerbert Xu2010-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brian Koropoff reported that the new var patches broke the following script: #!/bin/dash GDM_LANG="bar" OPTION="foo" unset GDM_LANG # OPTION has mysteriously become unset echo "$OPTION" He correctly diagnosed this as a result of removing all variables in the hash chain preceding the one that should be removed in setvareq. He also provided a patch to fix this. This patch is based on his but without keeping the original vpp. As a result, we now store new variables at the end of the hash chain instead of the beginning. To make this work, setvareq/setvar now returns the vp pointer modified. In case they're used to unset a variable the pointer returned is undefined. This is because mklocal needs it and used to get it by assuming that the new variable always appear at the beginning of the chain. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [VAR] Fix poplocalvar on abnormal exit from functionHerbert Xu2010-05-27
| | | | | | | | | | The new localvar code broke the abnormal exit from functions and built-ins by not restoring the original localvar state. This patch fixes this by storing the previous localvar state so that we always unwind correctly in case of an abnormal exit. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [VAR] Replace cmdenviron with localvarsHerbert Xu2010-05-26
| | | | | | | | | | This patch replaces the cmdenviron mechanism for temporary command variables with the localvars mechanism used by functions. This reduces code size, and more importantly, makes the variable assignment take effect immediately as required by POSIX. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [VAR] Move unsetvar functionality into setvareqHerbert Xu2010-05-26
| | | | | | | | This patch moves the unsetvar code into setvareq so that we can no have a pathological case of an unset variable hanging around unless it has a bit pinning it like VEXPORT. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [VAR] Add localvars nestingHerbert Xu2010-05-26
| | | | | | | This patch adds localvars nesting infrastructure so we can reuse the localvars mechanism for command evaluation. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [BUILTIN] Use setvarint to set OPTINDHerbert Xu2007-10-11
| | | | | This patch adds a flag argument to setvarint and uses it to set the OPTIND variable.
* [ARITH] Add assignment and intmax_t supportHerbert Xu2007-10-11
| | | | | This patch adds assignment operator support in arithmetic expansions. It also changes the type used to intmax_t.
* [VAR] Remove setvarsafeHerbert Xu2007-10-06
| | | | | The only user of setvarsafe is getopts. However, we can achieve the same result by pre-setting the value of shellparam.optind.
* Copyright/licence updates and remove all traces of sys/cdefs.hHerbert Xu2005-10-29
| | | | | | | | | | | This change updates the BSD licence to the three-clause version since NetBSD has already done so. This makes dash GPL-compatible. It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file. I've added "copyright by Herbert Xu" to most files. Finally all CVS IDs and inclusion of sys/cdefs.h have been removed. The latter is needed for support of klibc.
* Initial import.Herbert Xu2005-09-26