diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-22 19:02:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-22 19:02:27 +0000 |
commit | 93939fab956d0d6ac1dc6b2da86e53299ac3b7e5 (patch) | |
tree | ec079f7315ee615e019a23516bda584455eaec76 /app-shells/dash | |
parent | Version bump #259894 by Lars (Polynomial-C). (diff) | |
download | gentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.tar.gz gentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.tar.bz2 gentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.zip |
old
Diffstat (limited to 'app-shells/dash')
-rw-r--r-- | app-shells/dash/dash-0.5.3.7.ebuild | 49 | ||||
-rw-r--r-- | app-shells/dash/dash-0.5.4.1-r2.ebuild | 69 | ||||
-rw-r--r-- | app-shells/dash/dash-0.5.4.10.ebuild | 58 | ||||
-rw-r--r-- | app-shells/dash/dash-0.5.4.6-r1.ebuild | 58 | ||||
-rw-r--r-- | app-shells/dash/dash-0.5.4.9.ebuild | 58 | ||||
-rw-r--r-- | app-shells/dash/files/dash-0.5.3-read-length.patch | 13 | ||||
-rw-r--r-- | app-shells/dash/files/dash-0.5.3-sort-locale.patch | 11 | ||||
-rw-r--r-- | app-shells/dash/files/dash-0.5.4-posix-arith.patch | 420 |
8 files changed, 0 insertions, 736 deletions
diff --git a/app-shells/dash/dash-0.5.3.7.ebuild b/app-shells/dash/dash-0.5.3.7.ebuild deleted file mode 100644 index 25d76498e9f3..000000000000 --- a/app-shells/dash/dash-0.5.3.7.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.3.7.ebuild,v 1.7 2007/04/18 17:48:01 nixnut Exp $ - -inherit eutils flag-o-matic toolchain-funcs - -DEB_PV=${PV%.*} -DEB_PATCH=${PV##*.} -DEB_PF="${PN}_${DEB_PV}-${DEB_PATCH}" -MY_P="${PN}-${DEB_PV}" - -DESCRIPTION="DASH is a direct descendant of the NetBSD version of ash (the -Almquist SHell) and is POSIX compliant" -HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/" -SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${PN}-${DEB_PV}.tar.gz \ - mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 ppc x86" -IUSE="static" - -DEPEND="" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${WORKDIR}/${DEB_PF}".diff - - # Below patch sorts the builtincmd structure correctly when LC_ALL isn't C - epatch "${FILESDIR}/${MY_P}"-sort-locale.patch -} - -src_compile() { - use static && append-ldflags -static - - export CC="$(tc-getCC)" - econf || die "econf failed" - emake CFLAGS="${CFLAGS}" || die "emake failed" -} - -src_install() { - exeinto /bin - newexe src/dash dash - newman src/dash.1 dash.1 - dodoc COPYING ChangeLog -} diff --git a/app-shells/dash/dash-0.5.4.1-r2.ebuild b/app-shells/dash/dash-0.5.4.1-r2.ebuild deleted file mode 100644 index ff0a2a71467d..000000000000 --- a/app-shells/dash/dash-0.5.4.1-r2.ebuild +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.4.1-r2.ebuild,v 1.2 2008/01/26 20:14:31 vapier Exp $ - -inherit autotools eutils flag-o-matic toolchain-funcs - -DEB_PV=${PV%.*} -DEB_PATCH=${PV##*.} -DEB_PF="${PN}_${DEB_PV}-${DEB_PATCH}" -MY_P="${PN}-${DEB_PV}" - -DESCRIPTION="DASH is a direct descendant of the NetBSD version of ash (the Almquist SHell) and is POSIX compliant" -HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/" -SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${PN}-${DEB_PV}.tar.gz - mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~x86" -IUSE="libedit static" - -DEPEND="libedit? ( dev-libs/libedit )" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - - epatch "${WORKDIR}/${DEB_PF}".diff - - cd "${S}" - epatch debian/diff/* - - # Fix reading of long lines - epatch "${FILESDIR}/${PN}"-0.5.3-read-length.patch - - # Support posix arithmetic expansion - epatch "${FILESDIR}/${PN}"-0.5.4-posix-arith.patch - - # Fix the invalid sort - sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins - - # Always statically link libedit in to ensure we always boot if it changes - # which it has done in the past. - local s="s/-ledit/-Wl,-Bstatic -ledit -Wl,-Bdynamic -lcurses/g" - use static && s="s/-ledit/-ledit -lcurses/g" - sed -i -e "${s}" configure.ac || die "Failed to sed configure.ac" - - # May as well, as the debian patches force this anyway - eautoreconf -} - -src_compile() { - local myconf= - - use static && append-ldflags -static - use libedit && myconf="${myconf} --with-libedit" - export CC="$(tc-getCC)" - - econf ${myconf} || die "econf failed" - emake CFLAGS="${CFLAGS}" || die "emake failed" -} - -src_install() { - doman src/dash.1 - dodoc ChangeLog - into / - dobin src/dash || die -} diff --git a/app-shells/dash/dash-0.5.4.10.ebuild b/app-shells/dash/dash-0.5.4.10.ebuild deleted file mode 100644 index 8e70f1231a54..000000000000 --- a/app-shells/dash/dash-0.5.4.10.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.4.10.ebuild,v 1.1 2008/07/14 20:40:12 loki_val Exp $ - -inherit autotools eutils flag-o-matic - -DEB_PV=${PV%.*} -DEB_PATCH=${PV##*.} -DEB_PF="${PN}_${DEB_PV}-${DEB_PATCH}" -MY_P="${PN}-${DEB_PV}" - -DESCRIPTION="DASH is a direct descendant of the NetBSD version of ash (the Almquist SHell) and is POSIX compliant" -HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/" -SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${PN}-${DEB_PV}.tar.gz - mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="libedit static" - -DEPEND="libedit? ( dev-libs/libedit )" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - - epatch "${WORKDIR}"/${DEB_PF}.diff - cd "${S}" - epatch debian/diff/* - - # Fix the invalid sort - sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins - - # Always statically link libedit in to ensure we always boot if it changes - # which it has done in the past. - local s="s/-ledit/-Wl,-Bstatic -ledit -Wl,-Bdynamic -lcurses/g" - use static && s="s/-ledit/-ledit -lcurses/g" - sed -i -e "${s}" configure.ac || die "Failed to sed configure.ac" - - # May as well, as the debian patches force this anyway - eautoreconf -} - -src_compile() { - use static && append-ldflags -static - econf \ - --bindir=/bin \ - $(use_with libedit) \ - || die "econf failed" - emake || die -} - -src_install() { - emake install DESTDIR="${D}" || die - dodoc ChangeLog debian/changelog -} diff --git a/app-shells/dash/dash-0.5.4.6-r1.ebuild b/app-shells/dash/dash-0.5.4.6-r1.ebuild deleted file mode 100644 index cf12aa949e8f..000000000000 --- a/app-shells/dash/dash-0.5.4.6-r1.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.4.6-r1.ebuild,v 1.7 2008/05/06 15:49:12 jer Exp $ - -inherit autotools eutils flag-o-matic - -DEB_PV=${PV%.*} -DEB_PATCH=${PV##*.} -DEB_PF="${PN}_${DEB_PV}-${DEB_PATCH}" -MY_P="${PN}-${DEB_PV}" - -DESCRIPTION="DASH is a direct descendant of the NetBSD version of ash (the Almquist SHell) and is POSIX compliant" -HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/" -SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${PN}-${DEB_PV}.tar.gz - mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86" -IUSE="libedit static" - -DEPEND="libedit? ( dev-libs/libedit )" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - - epatch "${WORKDIR}"/${DEB_PF}.diff - cd "${S}" - epatch debian/diff/* - - # Fix the invalid sort - sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins - - # Always statically link libedit in to ensure we always boot if it changes - # which it has done in the past. - local s="s/-ledit/-Wl,-Bstatic -ledit -Wl,-Bdynamic -lcurses/g" - use static && s="s/-ledit/-ledit -lcurses/g" - sed -i -e "${s}" configure.ac || die "Failed to sed configure.ac" - - # May as well, as the debian patches force this anyway - eautoreconf -} - -src_compile() { - use static && append-ldflags -static - econf \ - --bindir=/bin \ - $(use_with libedit) \ - || die "econf failed" - emake || die -} - -src_install() { - emake install DESTDIR="${D}" || die - dodoc ChangeLog debian/changelog -} diff --git a/app-shells/dash/dash-0.5.4.9.ebuild b/app-shells/dash/dash-0.5.4.9.ebuild deleted file mode 100644 index b8174c93fb4e..000000000000 --- a/app-shells/dash/dash-0.5.4.9.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/dash/dash-0.5.4.9.ebuild,v 1.1 2008/05/31 07:33:11 vapier Exp $ - -inherit autotools eutils flag-o-matic - -DEB_PV=${PV%.*} -DEB_PATCH=${PV##*.} -DEB_PF="${PN}_${DEB_PV}-${DEB_PATCH}" -MY_P="${PN}-${DEB_PV}" - -DESCRIPTION="DASH is a direct descendant of the NetBSD version of ash (the Almquist SHell) and is POSIX compliant" -HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/" -SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${PN}-${DEB_PV}.tar.gz - mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="libedit static" - -DEPEND="libedit? ( dev-libs/libedit )" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - - epatch "${WORKDIR}"/${DEB_PF}.diff - cd "${S}" - epatch debian/diff/* - - # Fix the invalid sort - sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins - - # Always statically link libedit in to ensure we always boot if it changes - # which it has done in the past. - local s="s/-ledit/-Wl,-Bstatic -ledit -Wl,-Bdynamic -lcurses/g" - use static && s="s/-ledit/-ledit -lcurses/g" - sed -i -e "${s}" configure.ac || die "Failed to sed configure.ac" - - # May as well, as the debian patches force this anyway - eautoreconf -} - -src_compile() { - use static && append-ldflags -static - econf \ - --bindir=/bin \ - $(use_with libedit) \ - || die "econf failed" - emake || die -} - -src_install() { - emake install DESTDIR="${D}" || die - dodoc ChangeLog debian/changelog -} diff --git a/app-shells/dash/files/dash-0.5.3-read-length.patch b/app-shells/dash/files/dash-0.5.3-read-length.patch deleted file mode 100644 index 07bf834d37d2..000000000000 --- a/app-shells/dash/files/dash-0.5.3-read-length.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- src/expand.c -+++ src/expand.c -@@ -1643,7 +1643,10 @@ - size_t fulllen = len + strlen(p) + 1; - - if (flag & RMESCAPE_GROW) { -+ int strloc = str - (char *)stackblock(); - r = makestrspace(fulllen, expdest); -+ str = (char *)stackblock() + strloc; -+ p = str + len; - } else if (flag & RMESCAPE_HEAP) { - r = ckmalloc(fulllen); - } else { diff --git a/app-shells/dash/files/dash-0.5.3-sort-locale.patch b/app-shells/dash/files/dash-0.5.3-sort-locale.patch deleted file mode 100644 index 2494240e1df4..000000000000 --- a/app-shells/dash/files/dash-0.5.3-sort-locale.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- dash-0.5.3.orig/src/mkbuiltins 2005-11-26 03:17:55.000000000 +0000 -+++ dash-0.5.3/src/mkbuiltins 2007-03-15 21:23:51.448422603 +0000 -@@ -65,7 +65,7 @@ - if ($i ~ /^-/) - line = $(++i) "\t" line - print line -- }}' $temp | sort -k 1,1 | tee $temp2 | awk '{ -+ }}' $temp | LC_ALL=C sort -k 1,1 | tee $temp2 | awk '{ - opt = "" - if (NF > 2) { - opt = substr($2, 2) diff --git a/app-shells/dash/files/dash-0.5.4-posix-arith.patch b/app-shells/dash/files/dash-0.5.4-posix-arith.patch deleted file mode 100644 index 894008670ce1..000000000000 --- a/app-shells/dash/files/dash-0.5.4-posix-arith.patch +++ /dev/null @@ -1,420 +0,0 @@ -diff -ur a/src/arith.y b/src/arith.y ---- a/src/arith.y 2007-07-13 09:26:42.000000000 +0100 -+++ b/src/arith.y 2007-10-08 11:04:29.000000000 +0100 -@@ -34,14 +34,19 @@ - */ - - #include <stdlib.h> --#include "expand.h" -+#include <stdio.h> - #include "shell.h" -+#include "arith.h" -+#include "expand.h" - #include "error.h" - #include "output.h" - #include "memalloc.h" -+#include "var.h" - - const char *arith_buf, *arith_startbuf; - -+static int arith_assign(char *, arith_t); -+ - #ifndef YYBISON - int yyparse(void); - #endif -@@ -52,8 +57,18 @@ - #endif - - %} --%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN -- -+%union { -+ arith_t l_value; -+ char* s_value; -+} -+%token <l_value> ARITH_NUM ARITH_LPAREN ARITH_RPAREN -+%token <s_value> ARITH_VAR -+%type <l_value> expr -+%right ARITH_ASSIGN -+%right ARITH_ADDASSIGN ARITH_SUBASSIGN -+%right ARITH_MULASSIGN ARITH_DIVASSIGN ARITH_REMASSIGN -+%right ARITH_RSHASSIGN ARITH_LSHASSIGN -+%right ARITH_BANDASSIGN ARITH_BXORASSIGN ARITH_BORASSIGN - %left ARITH_OR - %left ARITH_AND - %left ARITH_BOR -@@ -105,8 +120,118 @@ - | ARITH_SUB expr %prec ARITH_UNARYMINUS { $$ = -($2); } - | ARITH_ADD expr %prec ARITH_UNARYPLUS { $$ = $2; } - | ARITH_NUM -- ; -+ | ARITH_VAR { -+ char *p; -+ arith_t arith_val; -+ char *str_val; -+ if (lookupvar($1) == NULL) -+ setvarsafe($1, "0", 0); -+ str_val = lookupvar($1); -+ arith_val = strtoarith_t(str_val, &p, 0); -+ /* -+ * Conversion is successful only in case -+ * we've converted _all_ characters. -+ */ -+ if (*p != '\0') -+ yyerror("variable conversion error"); -+ $$ = arith_val; -+ } -+ | ARITH_VAR ARITH_ASSIGN expr { -+ if (arith_assign($1, $3) != 0) -+ yyerror("variable assignment error"); -+ $$ = $3; -+ } -+ | ARITH_VAR ARITH_ADDASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) + $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_SUBASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) - $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_MULASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) * $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_DIVASSIGN expr { -+ arith_t value; -+ if ($3 == 0) -+ yyerror("division by zero"); -+ value = atoarith_t(lookupvar($1)) / $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_REMASSIGN expr { -+ arith_t value; -+ if ($3 == 0) -+ yyerror("division by zero"); -+ value = atoarith_t(lookupvar($1)) % $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_RSHASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) >> $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_LSHASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) << $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_BANDASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) & $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_BXORASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) ^ $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+ | ARITH_VAR ARITH_BORASSIGN expr { -+ arith_t value; -+ value = atoarith_t(lookupvar($1)) | $3; -+ if (arith_assign($1, value) != 0) -+ yyerror("variable assignment error"); -+ $$ = value; -+ } -+; - %% -+ -+#define lstrlen(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3) -+ -+static int -+arith_assign(char *name, arith_t value) { -+ char *str; -+ int ret; -+ -+ str = (char *)ckmalloc(lstrlen(value)); -+ sprintf(str, ARITH_FORMAT_STR, value); -+ ret = setvarsafe(name, str, 0); -+ free(str); -+ return ret; -+} -+ - int - arith(s) - const char *s; -diff -ur a/src/arith_yylex.c b/src/arith_yylex.c ---- a/src/arith_yylex.c 2007-07-13 09:26:42.000000000 +0100 -+++ b/src/arith_yylex.c 2007-10-08 11:10:44.000000000 +0100 -@@ -32,12 +32,16 @@ - * SUCH DAMAGE. - */ - -+#include <ctype.h> - #include <stdlib.h> -+#include <string.h> -+#include "shell.h" - #include "arith.h" - #include "expand.h" - #include "error.h" -+#include "memalloc.h" -+#include "var.h" - --extern int yylval; - extern const char *arith_buf, *arith_startbuf; - - int -@@ -45,6 +49,9 @@ - { - int value; - const char *buf = arith_buf; -+ char *temp; -+ char *var; -+ char save; - - for (;;) { - switch (*buf) { -@@ -54,10 +61,16 @@ - buf++; - continue; - default: --err: - sh_error("arith: syntax error: \"%s\"", arith_startbuf); - /* NOTREACHED */ - case '0': -+ if (*++buf == 'x') -+ yylval.l_value = strtoll(buf+1, (char **)&arith_buf, 16); -+ else -+ yylval.l_value = strtoll(buf, (char **)&arith_buf, 8); -+ if (isalnum(*arith_buf) || *arith_buf == '_') -+ sh_error("arith: value does not fit base: \"%s\"", arith_buf); -+ return ARITH_NUM; - case '1': - case '2': - case '3': -@@ -67,11 +80,79 @@ - case '7': - case '8': - case '9': -- yylval = strtoll(buf, (char **) &arith_buf, 0); -+ yylval.l_value = strtoll(buf, (char **)&arith_buf, 10); -+ if (isalnum(*arith_buf) || *arith_buf == '_') -+ sh_error("arith: value does not fit base: \"%s\"", arith_buf); - return ARITH_NUM; -+ case 'A': -+ case 'B': -+ case 'C': -+ case 'D': -+ case 'E': -+ case 'F': -+ case 'G': -+ case 'H': -+ case 'I': -+ case 'J': -+ case 'K': -+ case 'L': -+ case 'M': -+ case 'N': -+ case 'O': -+ case 'P': -+ case 'Q': -+ case 'R': -+ case 'S': -+ case 'T': -+ case 'U': -+ case 'V': -+ case 'W': -+ case 'X': -+ case 'Y': -+ case 'Z': -+ case 'a': -+ case 'b': -+ case 'c': -+ case 'd': -+ case 'e': -+ case 'f': -+ case 'g': -+ case 'h': -+ case 'i': -+ case 'j': -+ case 'k': -+ case 'l': -+ case 'm': -+ case 'n': -+ case 'o': -+ case 'p': -+ case 'q': -+ case 'r': -+ case 's': -+ case 't': -+ case 'u': -+ case 'v': -+ case 'w': -+ case 'x': -+ case 'y': -+ case 'z': -+ temp = (char *)buf; -+ while ((*temp && -+ (isalnum(*temp) || *temp == '_'))) -+ temp++; -+ save = *temp; -+ *temp = '\0'; -+ if (lookupvar(buf) == NULL) -+ setvarsafe(buf, "0", 0); -+ var = (char *)ckmalloc(strlen(buf) + 1); -+ yylval.s_value = strcpy(var, buf); -+ *temp = save; -+ arith_buf = temp; -+ return ARITH_VAR; - case '=': - if (*++buf != '=') { -- goto err; -+ value = ARITH_ASSIGN; -+ goto out; - } - value = ARITH_EQ; - break; -@@ -94,7 +175,11 @@ - value = ARITH_LE; - break; - case '<': -- value = ARITH_LSHIFT; -+ if (*++buf != '=') { -+ value = ARITH_LSHIFT; -+ goto out; -+ } -+ value = ARITH_LSHASSIGN; - break; - default: - value = ARITH_LT; -@@ -102,19 +187,29 @@ - } - break; - case '|': -- if (*++buf != '|') { -+ switch (*++buf) { -+ case '|': - value = ARITH_BOR; -+ break; -+ case '=': -+ value = ARITH_BORASSIGN; -+ break; -+ default: -+ value = ARITH_OR; - goto out; - } -- value = ARITH_OR; -- break; - case '&': -- if (*++buf != '&') { -+ switch (*++buf) { -+ case '&': -+ value = ARITH_AND; -+ break; -+ case '=': -+ value = ARITH_BANDASSIGN; -+ break; -+ default: - value = ARITH_BAND; - goto out; - } -- value = ARITH_AND; -- break; - case '!': - if (*++buf != '=') { - value = ARITH_NOT; -@@ -132,25 +227,49 @@ - value = ARITH_RPAREN; - break; - case '*': -- value = ARITH_MUL; -+ if (*++buf != '=') { -+ value = ARITH_MUL; -+ goto out; -+ } -+ value = ARITH_MULASSIGN; - break; - case '/': -- value = ARITH_DIV; -+ if (*++buf != '=') { -+ value = ARITH_DIV; -+ goto out; -+ } -+ value = ARITH_DIVASSIGN; - break; - case '%': -- value = ARITH_REM; -+ if (*++buf != '=') { -+ value = ARITH_REM; -+ goto out; -+ } -+ value = ARITH_REMASSIGN; - break; - case '+': -- value = ARITH_ADD; -+ if (*++buf != '=') { -+ value = ARITH_ADD; -+ goto out; -+ } -+ value = ARITH_ADDASSIGN; - break; - case '-': -- value = ARITH_SUB; -+ if (*++buf != '=') { -+ value = ARITH_SUB; -+ goto out; -+ } -+ value = ARITH_SUBASSIGN; - break; - case '~': - value = ARITH_BNOT; - break; - case '^': -- value = ARITH_BXOR; -+ if (*++buf != '=') { -+ value = ARITH_BXOR; -+ goto out; -+ } -+ value = ARITH_BXORASSIGN; - break; - } - break; -diff -ur a/src/shell.h b/src/shell.h ---- a/src/shell.h 2007-07-13 09:26:43.000000000 +0100 -+++ b/src/shell.h 2007-10-08 11:04:29.000000000 +0100 -@@ -58,6 +58,15 @@ - #define BSD 1 - #endif - -+/* -+ * Type of used arithmetics. SUSv3 requires us to have at least signed long. -+ */ -+typedef long arith_t; -+#define ARITH_FORMAT_STR "%ld" -+#define atoarith_t(arg) strtol(arg, NULL, 0) -+#define strtoarith_t(nptr, endptr, base) strtol(nptr, endptr, base) -+ -+ - #ifndef DO_SHAREDVFORK - #if __NetBSD_Version__ >= 104000000 - #define DO_SHAREDVFORK |