summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-22 19:02:27 +0000
committerMike Frysinger <vapier@gentoo.org>2009-02-22 19:02:27 +0000
commit93939fab956d0d6ac1dc6b2da86e53299ac3b7e5 (patch)
treeec079f7315ee615e019a23516bda584455eaec76 /app-shells/dash/files
parentVersion bump #259894 by Lars (Polynomial-C). (diff)
downloadgentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.tar.gz
gentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.tar.bz2
gentoo-2-93939fab956d0d6ac1dc6b2da86e53299ac3b7e5.zip
old
Diffstat (limited to 'app-shells/dash/files')
-rw-r--r--app-shells/dash/files/dash-0.5.3-read-length.patch13
-rw-r--r--app-shells/dash/files/dash-0.5.3-sort-locale.patch11
-rw-r--r--app-shells/dash/files/dash-0.5.4-posix-arith.patch420
3 files changed, 0 insertions, 444 deletions
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