ports/core (2.3): bash: update to 3.2.5
![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
commit fd26ce68237522e680547abb255e1eaae8e010bb Author: Juergen Daubert <jue@jue.li> Date: Sat Nov 18 18:46:34 2006 +0100 bash: update to 3.2.5 diff --git a/bash/.md5sum b/bash/.md5sum index ecb38d6..69050a9 100644 --- a/bash/.md5sum +++ b/bash/.md5sum @@ -1,4 +1,4 @@ -bc337045fa4c5839babf0306cc9df6d0 bash-3.1-001-017.patch -46d32222ea0ee4b92d9cad3130498e30 bash-3.1-doc.patch -ef5304c4b22aaa5088972c792ed45d72 bash-3.1.tar.gz +ce83c3dbfbd4945851b0e4ff398e4df5 bash-3.2-001-005.patch +46d32222ea0ee4b92d9cad3130498e30 bash-3.2-doc.patch +00bfa16d58e034e3c2aa27f390390d30 bash-3.2.tar.gz 7b57ddfc0866bfe6ee5eb714723d69b7 profile diff --git a/bash/Pkgfile b/bash/Pkgfile index 3b2a4e2..9a56984 100644 --- a/bash/Pkgfile +++ b/bash/Pkgfile @@ -4,17 +4,17 @@ # Depends on: ncurses name=bash -version=3.1.17 +version=3.2.5 release=1 -source=(http://ftp.gnu.org/gnu/$name/$name-3.1.tar.gz \ - bash-3.1-001-017.patch \ - $name-3.1-doc.patch \ +source=(http://ftp.gnu.org/gnu/$name/$name-3.2.tar.gz \ + $name-3.2-001-005.patch \ + $name-3.2-doc.patch \ profile) build() { - cd $name-3.1 - patch -p1 < ../$name-3.1-001-017.patch - patch -p1 < ../$name-3.1-doc.patch + cd $name-3.2 + patch -p0 < $SRC/$name-3.2-001-005.patch + patch -p1 < $SRC/$name-3.2-doc.patch ./configure --prefix=/usr \ --exec-prefix= \ --disable-nls diff --git a/bash/bash-3.1-001-017.patch b/bash/bash-3.1-001-017.patch deleted file mode 100644 index 449f076..0000000 --- a/bash/bash-3.1-001-017.patch +++ /dev/null @@ -1,723 +0,0 @@ -Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org) -Date: 2006-04-11 -Initial Package Version: 3.1 -Origin: http://ftp.gnu.org/gnu/bash/bash-3.1-patches/ -Upstream Status: From Upstream -Description: Contains patches 001-017 from upstream - -diff -Naur bash-3.1.orig/arrayfunc.c bash-3.1/arrayfunc.c ---- bash-3.1.orig/arrayfunc.c 2005-07-04 17:25:58.000000000 -0700 -+++ bash-3.1/arrayfunc.c 2006-04-19 15:59:29.000000000 -0700 -@@ -592,11 +592,7 @@ - exp = (char *)xmalloc (len); - strncpy (exp, s, len - 1); - exp[len - 1] = '\0'; --#if 0 -- t = expand_string_to_string (exp, 0); --#else -- t = expand_string_to_string (exp, Q_DOUBLE_QUOTES); --#endif -+ t = expand_arith_string (exp, 0); - this_command_name = (char *)NULL; - val = evalexp (t, &expok); - free (t); -diff -Naur bash-3.1.orig/doc/bash.1 bash-3.1/doc/bash.1 ---- bash-3.1.orig/doc/bash.1 2005-10-12 08:40:52.000000000 -0700 -+++ bash-3.1/doc/bash.1 2006-04-19 15:58:34.000000000 -0700 -@@ -6,12 +6,12 @@ - .\" Case Western Reserve University - .\" chet@po.cwru.edu - .\" --.\" Last Change: Sat Aug 27 13:28:44 EDT 2005 -+.\" Last Change: Wed Dec 28 19:58:45 EST 2005 - .\" - .\" bash_builtins, strip all but Built-Ins section - .if \n(zZ=1 .ig zZ - .if \n(zY=1 .ig zY --.TH BASH 1 "2005 Aug 27" "GNU Bash-3.1-beta1" -+.TH BASH 1 "2005 Dec 28" "GNU Bash-3.1" - .\" - .\" There's some problem with having a `@' - .\" in a tagged paragraph with the BSD man macros. -@@ -677,8 +677,8 @@ - .B nocasematch - is enabled, the match is performed without regard to the case - of alphabetic characters. --The return value is 0 if the string matches or does not match --the pattern, respectively, and 1 otherwise. -+The return value is 0 if the string matches (\fB==\fP) or does not match -+(\fB!=\fP) the pattern, and 1 otherwise. - Any part of the pattern may be quoted to force it to be matched as a - string. - .if t .sp 0.5 -@@ -807,6 +807,12 @@ - as for pathname expansion (see - .B Pathname Expansion - below). -+The \fIword\fP is expanded using tilde -+expansion, parameter and variable expansion, arithmetic substituion, -+command substitution, process substitution and quote removal. -+Each \fIpattern\fP examined is expanded using tilde -+expansion, parameter and variable expansion, arithmetic substituion, -+command substitution, and process substitution. - If the shell option - .B nocasematch - is enabled, the match is performed without regard to the case -@@ -8484,7 +8490,7 @@ - returns true if any of the arguments are found, false if - none are found. - .TP --\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]] -+\fBulimit\fP [\fB\-SHacdfilmnpqstuvx\fP [\fIlimit\fP]] - Provides control over the resources available to the shell and to - processes started by it, on systems that allow such control. - The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is -@@ -8523,6 +8529,9 @@ - .B \-f - The maximum size of files created by the shell - .TP -+.B \-i -+The maximum number of pending signals -+.TP - .B \-l - The maximum size that may be locked into memory - .TP -@@ -8536,6 +8545,9 @@ - .B \-p - The pipe size in 512-byte blocks (this may not be set) - .TP -+.B \-q -+The maximum number of bytes in POSIX message queues -+.TP - .B \-s - The maximum stack size - .TP -@@ -8547,6 +8559,9 @@ - .TP - .B \-v - The maximum amount of virtual memory available to the shell -+.TP -+.B \-x -+The maximum number of file locks - .PD - .PP - If -diff -Naur bash-3.1.orig/doc/bashref.texi bash-3.1/doc/bashref.texi ---- bash-3.1.orig/doc/bashref.texi 2005-10-03 12:07:21.000000000 -0700 -+++ bash-3.1/doc/bashref.texi 2006-04-19 15:58:34.000000000 -0700 -@@ -961,8 +961,8 @@ - (see the description of @code{shopt} in @ref{Bash Builtins}) - is enabled, the match is performed without regard to the case - of alphabetic characters. --The return value is 0 if the string matches or does not match --the pattern, respectively, and 1 otherwise. -+The return value is 0 if the string matches (@samp{==}) or does not -+match (@samp{!=})the pattern, and 1 otherwise. - Any part of the pattern may be quoted to force it to be matched as a - string. - -@@ -2598,7 +2598,7 @@ - Builtin commands are necessary to implement functionality impossible - or inconvenient to obtain with separate utilities. - --This section briefly the builtins which Bash inherits from -+This section briefly describes the builtins which Bash inherits from - the Bourne Shell, as well as the builtin commands which are unique - to or have been extended in Bash. - -@@ -3833,7 +3833,7 @@ - @item ulimit - @btindex ulimit - @example --ulimit [-acdflmnpstuvSH] [@var{limit}] -+ulimit [-acdfilmnpqstuvxSH] [@var{limit}] - @end example - @code{ulimit} provides control over the resources available to processes - started by the shell, on systems that allow such control. If an -@@ -3857,6 +3857,9 @@ - @item -f - The maximum size of files created by the shell. - -+@item -i -+The maximum number of pending signals. -+ - @item -l - The maximum size that may be locked into memory. - -@@ -3869,6 +3872,9 @@ - @item -p - The pipe buffer size. - -+@item -q -+The maximum number of bytes in POSIX message queues. -+ - @item -s - The maximum stack size. - -@@ -3881,6 +3887,9 @@ - @item -v - The maximum amount of virtual memory available to the process. - -+@item -x -+The maximum number of file locks. -+ - @end table - - If @var{limit} is given, it is the new value of the specified resource; -@@ -4089,8 +4098,8 @@ - Print shell input lines as they are read. - - @item -x --Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP --commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands -+Print a trace of simple commands, @code{for} commands, @code{case} -+commands, @code{select} commands, and arithmetic @code{for} commands - and their arguments or associated word lists after they are - expanded and before they are executed. The value of the @env{PS4} - variable is expanded and the resultant value is printed before -diff -Naur bash-3.1.orig/doc/version.texi bash-3.1/doc/version.texi ---- bash-3.1.orig/doc/version.texi 2005-09-20 11:52:56.000000000 -0700 -+++ bash-3.1/doc/version.texi 2006-04-19 15:58:34.000000000 -0700 -@@ -2,9 +2,9 @@ - Copyright (C) 1988-2005 Free Software Foundation, Inc. - @end ignore - --@set LASTCHANGE Mon Sep 5 11:47:04 EDT 2005 -+@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005 - --@set EDITION 3.1-beta1 --@set VERSION 3.1-beta1 --@set UPDATED 5 September 2005 --@set UPDATED-MONTH September 2005 -+@set EDITION 3.1 -+@set VERSION 3.1 -+@set UPDATED 30 December 2005 -+@set UPDATED-MONTH December 2005 -diff -Naur bash-3.1.orig/jobs.c bash-3.1/jobs.c ---- bash-3.1.orig/jobs.c 2005-11-11 20:13:27.000000000 -0800 -+++ bash-3.1/jobs.c 2006-04-19 15:58:34.000000000 -0700 -@@ -619,8 +619,11 @@ - * once in the parent and once in each child. This is where - * the parent gives it away. - * -+ * Don't give the terminal away if this shell is an asynchronous -+ * subshell. -+ * - */ -- if (job_control && newjob->pgrp) -+ if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) - give_terminal_to (newjob->pgrp, 0); - } - } -@@ -844,9 +847,10 @@ - realloc_jobs_list () - { - sigset_t set, oset; -- int nsize, i, j; -+ int nsize, i, j, ncur, nprev; - JOB **nlist; - -+ ncur = nprev = NO_JOB; - nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS); - nsize *= JOB_SLOTS; - i = js.j_njobs % JOB_SLOTS; -@@ -854,17 +858,51 @@ - nsize += JOB_SLOTS; - - BLOCK_CHILD (set, oset); -- nlist = (JOB **) xmalloc (nsize * sizeof (JOB *)); -+ nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *)); -+ - for (i = j = 0; i < js.j_jobslots; i++) - if (jobs[i]) -- nlist[j++] = jobs[i]; -+ { -+ if (i == js.j_current) -+ ncur = j; -+ if (i == js.j_previous) -+ nprev = j; -+ nlist[j++] = jobs[i]; -+ } -+ -+#if defined (DEBUG) -+ itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize); -+ itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0); -+ itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, (j > 0) ? j - 1 : 0); -+#endif - - js.j_firstj = 0; -- js.j_lastj = (j > 0) ? j - 1: 0; -+ js.j_lastj = (j > 0) ? j - 1 : 0; -+ js.j_njobs = j; - js.j_jobslots = nsize; - -- free (jobs); -- jobs = nlist; -+ /* Zero out remaining slots in new jobs list */ -+ for ( ; j < nsize; j++) -+ nlist[j] = (JOB *)NULL; -+ -+ if (jobs != nlist) -+ { -+ free (jobs); -+ jobs = nlist; -+ } -+ -+ if (ncur != NO_JOB) -+ js.j_current = ncur; -+ if (nprev != NO_JOB) -+ js.j_previous = nprev; -+ -+ /* Need to reset these */ -+ if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj) -+ reset_current (); -+ -+#ifdef DEBUG -+ itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous); -+#endif - - UNBLOCK_CHILD (oset); - } -@@ -1655,7 +1693,7 @@ - In this case, we don't want to give the terminal to the - shell's process group (we could be in the middle of a - pipeline, for example). */ -- if (async_p == 0 && pipeline_pgrp != shell_pgrp) -+ if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0)) - give_terminal_to (pipeline_pgrp, 0); - - #if defined (PGRP_PIPE) -@@ -2198,7 +2236,11 @@ - /* This is possibly a race condition -- should it go in stop_pipeline? */ - wait_sigint_received = 0; - if (job_control == 0) -- old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); -+ { -+ old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); -+ if (old_sigint_handler == SIG_IGN) -+ set_signal_handler (SIGINT, old_sigint_handler); -+ } - - termination_state = last_command_exit_value; - -diff -Naur bash-3.1.orig/lib/glob/glob.c bash-3.1/lib/glob/glob.c ---- bash-3.1.orig/lib/glob/glob.c 2005-03-24 09:42:27.000000000 -0800 -+++ bash-3.1/lib/glob/glob.c 2006-04-19 15:58:34.000000000 -0700 -@@ -360,6 +360,7 @@ - count = lose = skip = 0; - - firstmalloc = 0; -+ nalloca = 0; - - /* If PAT is empty, skip the loop, but return one (empty) filename. */ - if (pat == 0 || *pat == '\0') -@@ -546,6 +547,8 @@ - firstmalloc = 0; - tmplink = lastlink; - } -+ else -+ tmplink = 0; - free (lastlink->name); - lastlink = lastlink->next; - FREE (tmplink); -diff -Naur bash-3.1.orig/lib/glob/sm_loop.c bash-3.1/lib/glob/sm_loop.c ---- bash-3.1.orig/lib/glob/sm_loop.c 2005-10-16 18:21:04.000000000 -0700 -+++ bash-3.1/lib/glob/sm_loop.c 2006-04-19 15:58:34.000000000 -0700 -@@ -638,12 +638,13 @@ - CHAR *psub; /* pointer to sub-pattern */ - CHAR *pnext; /* pointer to next sub-pattern */ - CHAR *srest; /* pointer to rest of string */ -- int m1, m2; -+ int m1, m2, xflags; /* xflags = flags passed to recursive matches */ - - #if DEBUG_MATCHING - fprintf(stderr, "extmatch: xc = %c\n", xc); - fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se); - fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe); -+fprintf(stderr, "extmatch: flags = %d\n", flags); - #endif - - prest = PATSCAN (p + (*p == L('(')), pe, 0); /* ) */ -@@ -677,8 +678,12 @@ - string matches the rest of the pattern. Also handle - multiple matches of the pattern. */ - if (m1) -- m2 = (GMATCH (srest, se, prest, pe, flags) == 0) || -- (s != srest && GMATCH (srest, se, p - 1, pe, flags) == 0); -+ { -+ /* if srest > s, we are not at start of string */ -+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; -+ m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) || -+ (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0); -+ } - if (m1 && m2) - return (0); - } -@@ -704,8 +709,10 @@ - srest = (prest == pe) ? se : s; - for ( ; srest <= se; srest++) - { -+ /* if srest > s, we are not at start of string */ -+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; - if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 && -- GMATCH (srest, se, prest, pe, flags) == 0) -+ GMATCH (srest, se, prest, pe, xflags) == 0) - return (0); - } - if (pnext == prest) -@@ -726,7 +733,9 @@ - if (pnext == prest) - break; - } -- if (m1 == 0 && GMATCH (srest, se, prest, pe, flags) == 0) -+ /* if srest > s, we are not at start of string */ -+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; -+ if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0) - return (0); - } - return (FNM_NOMATCH); -diff -Naur bash-3.1.orig/lib/readline/display.c bash-3.1/lib/readline/display.c ---- bash-3.1.orig/lib/readline/display.c 2005-11-30 11:05:02.000000000 -0800 -+++ bash-3.1/lib/readline/display.c 2006-04-19 15:58:34.000000000 -0700 -@@ -1983,11 +1983,15 @@ - int pchar; - { - int len; -- char *pmt; -+ char *pmt, *p; - - rl_save_prompt (); - -- if (saved_local_prompt == 0) -+ /* We've saved the prompt, and can do anything with the various prompt -+ strings we need before they're restored. We want the unexpanded -+ portion of the prompt string after any final newline. */ -+ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; -+ if (p == 0) - { - len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; - pmt = (char *)xmalloc (len + 2); -@@ -1998,19 +2002,17 @@ - } - else - { -- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0; -+ p++; -+ len = strlen (p); - pmt = (char *)xmalloc (len + 2); - if (len) -- strcpy (pmt, saved_local_prompt); -+ strcpy (pmt, p); - pmt[len] = pchar; - pmt[len+1] = '\0'; -- local_prompt = savestring (pmt); -- prompt_last_invisible = saved_last_invisible; -- prompt_visible_length = saved_visible_length + 1; -- } -+ } - -+ /* will be overwritten by expand_prompt, called from rl_message */ - prompt_physical_chars = saved_physical_chars + 1; -- - return pmt; - } - -diff -Naur bash-3.1.orig/lib/readline/readline.c bash-3.1/lib/readline/readline.c ---- bash-3.1.orig/lib/readline/readline.c 2005-07-04 19:29:35.000000000 -0700 -+++ bash-3.1/lib/readline/readline.c 2006-04-19 15:58:34.000000000 -0700 -@@ -282,6 +282,7 @@ - { - FREE (rl_prompt); - rl_prompt = prompt ? savestring (prompt) : (char *)NULL; -+ rl_display_prompt = rl_prompt ? rl_prompt : ""; - - rl_visible_prompt_length = rl_expand_prompt (rl_prompt); - return 0; -diff -Naur bash-3.1.orig/lib/readline/terminal.c bash-3.1/lib/readline/terminal.c ---- bash-3.1.orig/lib/readline/terminal.c 2005-11-12 17:46:54.000000000 -0800 -+++ bash-3.1/lib/readline/terminal.c 2006-04-19 15:58:34.000000000 -0700 -@@ -122,7 +122,7 @@ - static char *_rl_visible_bell; - - /* Non-zero means the terminal can auto-wrap lines. */ --int _rl_term_autowrap; -+int _rl_term_autowrap = -1; - - /* Non-zero means that this terminal has a meta key. */ - static int term_has_meta; -@@ -274,6 +274,9 @@ - _rl_set_screen_size (rows, cols) - int rows, cols; - { -+ if (_rl_term_autowrap == -1) -+ _rl_init_terminal_io (rl_terminal_name); -+ - if (rows > 0) - _rl_screenheight = rows; - if (cols > 0) -diff -Naur bash-3.1.orig/parse.y bash-3.1/parse.y ---- bash-3.1.orig/parse.y 2005-11-11 20:14:18.000000000 -0800 -+++ bash-3.1/parse.y 2006-04-19 15:58:34.000000000 -0700 -@@ -2716,6 +2716,7 @@ - #define P_ALLOWESC 0x02 - #define P_DQUOTE 0x04 - #define P_COMMAND 0x08 /* parsing a command, so look for comments */ -+#define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */ - - static char matched_pair_error; - static char * -@@ -2725,12 +2726,12 @@ - int *lenp, flags; - { - int count, ch, was_dollar, in_comment, check_comment; -- int pass_next_character, nestlen, ttranslen, start_lineno; -+ int pass_next_character, backq_backslash, nestlen, ttranslen, start_lineno; - char *ret, *nestret, *ttrans; - int retind, retsize, rflags; - - count = 1; -- pass_next_character = was_dollar = in_comment = 0; -+ pass_next_character = backq_backslash = was_dollar = in_comment = 0; - check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; - - /* RFLAGS is the set of flags we want to pass to recursive calls. */ -@@ -2742,11 +2743,8 @@ - start_lineno = line_number; - while (count) - { --#if 0 -- ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0); --#else -- ch = shell_getc (qc != '\'' && pass_next_character == 0); --#endif -+ ch = shell_getc (qc != '\'' && pass_next_character == 0 && backq_backslash == 0); -+ - if (ch == EOF) - { - free (ret); -@@ -2771,9 +2769,16 @@ - continue; - } - /* Not exactly right yet */ -- else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1]))) -+ else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1]))) - in_comment = 1; - -+ /* last char was backslash inside backquoted command substitution */ -+ if (backq_backslash) -+ { -+ backq_backslash = 0; -+ /* Placeholder for adding special characters */ -+ } -+ - if (pass_next_character) /* last char was backslash */ - { - pass_next_character = 0; -@@ -2814,6 +2819,8 @@ - { - if MBTEST((flags & P_ALLOWESC) && ch == '\\') - pass_next_character++; -+ else if MBTEST((flags & P_BACKQUOTE) && ch == '\\') -+ backq_backslash++; - continue; - } - -@@ -2898,7 +2905,11 @@ - } - else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0) - { -- nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags); -+ /* Add P_BACKQUOTE so backslash quotes the next character and -+ shell_getc does the right thing with \<newline>. We do this for -+ a measure of backwards compatibility -- it's not strictly the -+ right POSIX thing. */ -+ nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_BACKQUOTE); - goto add_nestret; - } - else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ -@@ -2907,7 +2918,7 @@ - if (open == ch) /* undo previous increment */ - count--; - if (ch == '(') /* ) */ -- nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags); -+ nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags & ~P_DQUOTE); - else if (ch == '{') /* } */ - nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|rflags); - else if (ch == '[') /* ] */ -@@ -3578,7 +3589,7 @@ - FREE (ttok); - all_digit_token = 0; - compound_assignment = 1; --#if 0 -+#if 1 - goto next_character; - #else - goto got_token; /* ksh93 seems to do this */ -@@ -3695,7 +3706,9 @@ - struct builtin *b; - b = builtin_address_internal (token, 0); - if (b && (b->flags & ASSIGNMENT_BUILTIN)) -- parser_state |= PST_ASSIGNOK; -+ parser_state |= PST_ASSIGNOK; -+ else if (STREQ (token, "eval") || STREQ (token, "let")) -+ parser_state |= PST_ASSIGNOK; - } - - yylval.word = the_word; -@@ -4686,18 +4699,21 @@ - int *retlenp; - { - WORD_LIST *wl, *rl; -- int tok, orig_line_number, orig_token_size; -+ int tok, orig_line_number, orig_token_size, orig_last_token, assignok; - char *saved_token, *ret; - - saved_token = token; - orig_token_size = token_buffer_size; - orig_line_number = line_number; -+ orig_last_token = last_read_token; - - last_read_token = WORD; /* WORD to allow reserved words here */ - - token = (char *)NULL; - token_buffer_size = 0; - -+ assignok = parser_state&PST_ASSIGNOK; /* XXX */ -+ - wl = (WORD_LIST *)NULL; /* ( */ - parser_state |= PST_COMPASSIGN; - -@@ -4740,7 +4756,7 @@ - jump_to_top_level (DISCARD); - } - -- last_read_token = WORD; -+ last_read_token = orig_last_token; /* XXX - was WORD? */ - if (wl) - { - rl = REVERSE_LIST (wl, WORD_LIST *); -@@ -4752,6 +4768,10 @@ - - if (retlenp) - *retlenp = (ret && *ret) ? strlen (ret) : 0; -+ -+ if (assignok) -+ parser_state |= PST_ASSIGNOK; -+ - return ret; - } - -diff -Naur bash-3.1.orig/patchlevel.h bash-3.1/patchlevel.h ---- bash-3.1.orig/patchlevel.h 2005-07-20 10:58:20.000000000 -0700 -+++ bash-3.1/patchlevel.h 2006-04-19 15:59:29.000000000 -0700 -@@ -25,6 +25,6 @@ - regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh - looks for to find the patch level (for the sccs version string). */ - --#define PATCHLEVEL 0 -+#define PATCHLEVEL 17 - - #endif /* _PATCHLEVEL_H_ */ -diff -Naur bash-3.1.orig/subst.c bash-3.1/subst.c ---- bash-3.1.orig/subst.c 2005-10-24 06:51:13.000000000 -0700 -+++ bash-3.1/subst.c 2006-04-19 15:59:29.000000000 -0700 -@@ -2187,7 +2187,7 @@ - if (mklocal && variable_context) - { - v = find_variable (name); -- if (v == 0 || array_p (v) == 0) -+ if (v == 0 || array_p (v) == 0 || v->context != variable_context) - v = make_local_array_variable (name); - v = assign_array_var_from_string (v, value, flags); - } -@@ -2575,6 +2575,13 @@ - return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); - } - -+char * -+expand_arith_string (string, quoted) -+ char *string; -+{ -+ return (expand_string_if_necessary (string, quoted, expand_string)); -+} -+ - #if defined (COND_COMMAND) - /* Just remove backslashes in STRING. Returns a new string. */ - char * -@@ -5248,7 +5255,7 @@ - else - t = (char *)0; - -- temp1 = expand_string_if_necessary (substr, Q_DOUBLE_QUOTES, expand_string); -+ temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); - *e1p = evalexp (temp1, &expok); - free (temp1); - if (expok == 0) -@@ -5293,7 +5300,7 @@ - { - t++; - temp2 = savestring (t); -- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); -+ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); - free (temp2); - t[-1] = ':'; - *e2p = evalexp (temp1, &expok); -@@ -6435,7 +6442,7 @@ - temp2[t_index] = '\0'; - - /* Expand variables found inside the expression. */ -- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); -+ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); - free (temp2); - - arithsub: -@@ -6477,7 +6484,7 @@ - zindex = t_index; - - /* Do initial variable expansion. */ -- temp1 = expand_string_if_necessary (temp, Q_DOUBLE_QUOTES, expand_string); -+ temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); - - goto arithsub; - -@@ -6795,6 +6802,12 @@ - if (temp && *temp && t_index > 0) - { - temp1 = bash_tilde_expand (temp, tflag); -+ if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) -+ { -+ FREE (temp); -+ FREE (temp1); -+ goto add_character; /* tilde expansion failed */ -+ } - free (temp); - temp = temp1; - sindex += t_index; -diff -Naur bash-3.1.orig/subst.h bash-3.1/subst.h ---- bash-3.1.orig/subst.h 2004-11-07 12:12:28.000000000 -0800 -+++ bash-3.1/subst.h 2006-04-19 15:59:29.000000000 -0700 -@@ -151,6 +151,9 @@ - extern char *expand_string_unsplit_to_string __P((char *, int)); - extern char *expand_assignment_string_to_string __P((char *, int)); - -+/* Expand an arithmetic expression string */ -+extern char *expand_arith_string __P((char *, int)); -+ - /* De-quoted quoted characters in STRING. */ - extern char *dequote_string __P((char *)); - -diff -Naur bash-3.1.orig/variables.c bash-3.1/variables.c ---- bash-3.1.orig/variables.c 2005-11-12 18:22:37.000000000 -0800 -+++ bash-3.1/variables.c 2006-04-19 15:58:34.000000000 -0700 -@@ -860,9 +860,11 @@ - { - char val[INT_STRLEN_BOUND(int) + 1], *v; - -+#if defined (READLINE) - /* If we are currently assigning to LINES or COLUMNS, don't do anything. */ - if (winsize_assignment) - return; -+#endif - - v = inttostr (lines, val, sizeof (val)); - bind_variable ("LINES", v, 0); diff --git a/bash/bash-3.1-doc.patch b/bash/bash-3.1-doc.patch deleted file mode 100644 index 9fb0fc4..0000000 --- a/bash/bash-3.1-doc.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -Nru bash-3.0/doc/Makefile.in bash-3.0-new/doc/Makefile.in ---- bash-3.0/doc/Makefile.in 2004-07-27 14:57:48.000000000 +0200 -+++ bash-3.0-new/doc/Makefile.in 2005-02-02 23:29:13.401509336 +0100 -@@ -141,7 +141,7 @@ - ${RM} $@ - -${DVIPS} $< - --all: ps info dvi text html -+all: - nodvi: ps info text html - - PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps -@@ -220,21 +220,9 @@ - $(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \ - fi - --install: info installdirs bash.info -+install: installdirs - -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} - -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} --# uncomment the next line to install the builtins man page --# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} -- -$(INSTALL_DATA) $(srcdir)/bash.info $(DESTDIR)$(infodir)/bash.info --# run install-info if it is present to update the info directory -- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ -- install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ -- else true; fi --# if htmldir is set, install the html files into that directory -- -if test -n "${htmldir}" ; then \ -- $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \ -- $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \ -- fi - - uninstall: - -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext} diff --git a/bash/bash-3.2-001-005.patch b/bash/bash-3.2-001-005.patch new file mode 100644 index 0000000..3eb0951 --- /dev/null +++ b/bash/bash-3.2-001-005.patch @@ -0,0 +1,561 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-001 + +Bug-Reported-by: Greg Schafer <gschafer@zip.com.au> +Bug-Reference-ID: <20061012084940.GA15768@tigers.local> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-10/msg00046.html + +Bug-Description: + +When using historical ``-style command substitution, bash incorrectly attempts +to interpret shell comments while scanning for the closing backquote. + +Patch: + +*** ../bash-3.2/parse.y Tue Sep 19 16:37:21 2006 +--- parse.y Thu Oct 12 10:30:57 2006 +*************** +*** 2736,2740 **** + count = 1; + pass_next_character = backq_backslash = was_dollar = in_comment = 0; +! check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ +--- 2736,2740 ---- + count = 1; + pass_next_character = backq_backslash = was_dollar = in_comment = 0; +! check_comment = (flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 0 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-002 + +Bug-Reported-by: Jim Gifford <jim@jg555.com> +Bug-Reference-ID: <12j2pc3aq35mb04@corp.supernews.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-10/msg00082.html + +Bug-Description: + +An incorrect encoding specification in the Content-Type header causes msgfmt +to fail, which causes `make install' to fail. + +Patch: + +*** ../bash-3.2/po/ru.po Tue Jan 10 17:51:03 2006 +--- po/ru.po Mon Oct 16 15:13:23 2006 +*************** +*** 13,17 **** + "Language-Team: Russian <ru@li.org>\n" + "MIME-Version: 1.0\n" +! "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +--- 13,17 ---- + "Language-Team: Russian <ru@li.org>\n" + "MIME-Version: 1.0\n" +! "Content-Type: text/plain; charset=KOI8-R\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-003 + +Bug-Reported-by: John Gatewood Ham <zappaman@buraphalinux.org> +Bug-Reference-ID: <Pine.LNX.4.64.0610121334140.15558@www.buraphalinux.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-10/msg00045.html + +Bug-Description: + +When using the conditional command's `=~' operator to match regular +expressions, the parser did not skip over shell metacharacters in the +regular expression, leading to syntax errors. + +Patch: + +*** ../bash-3.2-patched/parse.y Tue Oct 17 11:45:20 2006 +--- parse.y Sat Oct 14 14:56:16 2006 +*************** +*** 1029,1034 **** +--- 1029,1035 ---- + #define PST_CMDTOKEN 0x1000 /* command token OK - unused */ + #define PST_COMPASSIGN 0x2000 /* parsing x=(...) compound assignment */ + #define PST_ASSIGNOK 0x4000 /* assignment statement ok in this context */ ++ #define PST_REGEXP 0x8000 /* parsing an ERE/BRE as a single word */ + + /* Initial size to allocate for tokens, and the + amount to grow them by. */ +*************** +*** 2591,2596 **** +--- 2592,2600 ---- + return (character); + } + ++ if (parser_state & PST_REGEXP) ++ goto tokword; ++ + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +*************** +*** 2698,2703 **** +--- 2702,2708 ---- + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + ++ tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +*************** +*** 3202,3209 **** + if (tok == WORD && test_binop (yylval.word->word)) + op = yylval.word; + #if defined (COND_REGEXP) +! else if (tok == WORD && STREQ (yylval.word->word,"=~")) +! op = yylval.word; + #endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ +--- 3207,3217 ---- + if (tok == WORD && test_binop (yylval.word->word)) + op = yylval.word; + #if defined (COND_REGEXP) +! else if (tok == WORD && STREQ (yylval.word->word, "=~")) +! { +! op = yylval.word; +! parser_state |= PST_REGEXP; +! } + #endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ +*************** +*** 3234,3239 **** +--- 3242,3248 ---- + + /* rhs */ + tok = read_token (READ); ++ parser_state &= ~PST_REGEXP; + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); +*************** +*** 3419,3427 **** + goto next_character; + } + + #ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ +! if (extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ +--- 3428,3461 ---- + goto next_character; + } + ++ #ifdef COND_REGEXP ++ /* When parsing a regexp as a single word inside a conditional command, ++ we need to special-case characters special to both the shell and ++ regular expressions. Right now, that is only '(' and '|'. */ /*)*/ ++ if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ ++ { ++ if (character == '|') ++ goto got_character; ++ ++ push_delimiter (dstack, character); ++ ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); ++ pop_delimiter (dstack); ++ if (ttok == &matched_pair_error) ++ return -1; /* Bail immediately. */ ++ RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, ++ token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); ++ token[token_index++] = character; ++ strcpy (token + token_index, ttok); ++ token_index += ttoklen; ++ FREE (ttok); ++ dollar_present = all_digit_token = 0; ++ goto next_character; ++ } ++ #endif /* COND_REGEXP */ ++ + #ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ +! if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ + + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-004 + +Bug-Reported-by: Stuart Shelton <srcshelton@gmail.com> +Bug-Reference-ID: <619141e40610261203y6cda5aa6i23cb24c7aeba996e@mail.gmail.com> +Bug-Reference-URL: + +Bug-Description: + +A bug in the parameter pattern substitution implementation treated a pattern +whose first character was `/' (after expansion) as specifying global +replacement. + +Patch: + +*** ../bash-3.2/subst.c Tue Sep 19 08:35:09 2006 +--- subst.c Thu Oct 26 09:17:50 2006 +*************** +*** 5707,5712 **** +--- 5707,5717 ---- + vtype &= ~VT_STARSUB; + + mflags = 0; ++ if (patsub && *patsub == '/') ++ { ++ mflags |= MATCH_GLOBREP; ++ patsub++; ++ } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ +*************** +*** 5741,5753 **** + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded +! pattern. This is an extension. */ + p = pat; +! if (pat && pat[0] == '/') +! { +! mflags |= MATCH_GLOBREP|MATCH_ANY; +! p++; +! } + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; +--- 5746,5757 ---- + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded +! pattern. This is an extension. Make sure we don't anchor the pattern +! at the beginning or end of the string if we're doing global replacement, +! though. */ + p = pat; +! if (mflags & MATCH_GLOBREP) +! mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; +*** ../bash-3.2/tests/new-exp.right Thu Aug 10 12:00:00 2006 +--- tests/new-exp.right Sun Oct 29 16:03:36 2006 +*************** +*** 430,436 **** + Case06---1---A B C::--- + Case07---3---A:B:C--- + Case08---3---A:B:C--- +! ./new-exp.tests: line 506: /${$(($#-1))}: bad substitution + argv[1] = <a> + argv[2] = <b> + argv[3] = <c> +--- 430,436 ---- + Case06---1---A B C::--- + Case07---3---A:B:C--- + Case08---3---A:B:C--- +! ./new-exp.tests: line 506: ${$(($#-1))}: bad substitution + argv[1] = <a> + argv[2] = <b> + argv[3] = <c> +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-005 + +Bug-Reported-by: Stuart Shelton <stuart@openobjects.com> +Bug-Reference-ID: <453F7CC8.6030907@openobjects.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-10/msg00127.html + +Bug-Description: + +A missing extern declaration for `asprintf' caused `double' arguments to be +passed as `0', leading to incorrect results. Additionally, a bug in the +replacement asprintf/snprintf function caused an infinite loop when passed +0 arguments to the floating point conversions under some circumstances. + +Patch: + +*** ../bash-3.2/builtins/printf.def Mon Sep 18 08:48:42 2006 +--- builtins/printf.def Tue Oct 31 08:19:44 2006 +*************** +*** 49,54 **** +--- 49,60 ---- + # define INT_MIN (-2147483647-1) + #endif + ++ #if defined (PREFER_STDARG) ++ # include <stdarg.h> ++ #else ++ # include <varargs.h> ++ #endif ++ + #include <stdio.h> + #include <chartypes.h> + +*************** +*** 151,156 **** +--- 157,166 ---- + #define SKIP1 "#'-+ 0" + #define LENMODS "hjlLtz" + ++ #ifndef HAVE_ASPRINTF ++ extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); ++ #endif ++ + static void printf_erange __P((char *)); + static int printstr __P((char *, char *, int, int, int)); + static int tescape __P((char *, char *, int *)); + + +*** ../bash-3.2/lib/sh/snprintf.c Thu Apr 6 09:48:40 2006 +--- lib/sh/snprintf.c Sat Oct 28 00:00:13 2006 +*************** +*** 471,476 **** +--- 476,483 ---- + 10^x ~= r + * log_10(200) = 2; + * log_10(250) = 2; ++ * ++ * NOTE: do not call this with r == 0 -- an infinite loop results. + */ + static int + log_10(r) +*************** +*** 576,583 **** + { + integral_part[0] = '0'; + integral_part[1] = '\0'; +! fraction_part[0] = '0'; +! fraction_part[1] = '\0'; + if (fract) + *fract = fraction_part; + return integral_part; +--- 583,593 ---- + { + integral_part[0] = '0'; + integral_part[1] = '\0'; +! /* The fractional part has to take the precision into account */ +! for (ch = 0; ch < precision-1; ch++) +! fraction_part[ch] = '0'; +! fraction_part[ch] = '0'; +! fraction_part[ch+1] = '\0'; + if (fract) + *fract = fraction_part; + return integral_part; +*************** +*** 805,810 **** +--- 815,821 ---- + PUT_CHAR(*tmp, p); + tmp++; + } ++ + PAD_LEFT(p); + } + +*************** +*** 972,982 **** + if ((p->flags & PF_THOUSANDS) && grouping && (t = groupnum (tmp))) + tmp = t; + + /* calculate the padding. 1 for the dot */ + p->width = p->width - + ((d > 0. && p->justify == RIGHT) ? 1:0) - + ((p->flags & PF_SPACE) ? 1:0) - +! strlen(tmp) - p->precision - 1; + PAD_RIGHT(p); + PUT_PLUS(d, p, 0.); + PUT_SPACE(d, p, 0.); +--- 983,1003 ---- + if ((p->flags & PF_THOUSANDS) && grouping && (t = groupnum (tmp))) + tmp = t; + ++ if ((*p->pf == 'g' || *p->pf == 'G') && (p->flags & PF_ALTFORM) == 0) ++ { ++ /* smash the trailing zeros unless altform */ ++ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) ++ tmp2[i] = '\0'; ++ if (tmp2[0] == '\0') ++ p->precision = 0; ++ } ++ + /* calculate the padding. 1 for the dot */ + p->width = p->width - + ((d > 0. && p->justify == RIGHT) ? 1:0) - + ((p->flags & PF_SPACE) ? 1:0) - +! strlen(tmp) - p->precision - +! ((p->precision != 0 || (p->flags & PF_ALTFORM)) ? 1 : 0); /* radix char */ + PAD_RIGHT(p); + PUT_PLUS(d, p, 0.); + PUT_SPACE(d, p, 0.); +*************** +*** 991,1001 **** + if (p->precision != 0 || (p->flags & PF_ALTFORM)) + PUT_CHAR(decpoint, p); /* put the '.' */ + +- if ((*p->pf == 'g' || *p->pf == 'G') && (p->flags & PF_ALTFORM) == 0) +- /* smash the trailing zeros unless altform */ +- for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) +- tmp2[i] = '\0'; +- + for (; *tmp2; tmp2++) + PUT_CHAR(*tmp2, p); /* the fraction */ + +--- 1012,1017 ---- +*************** +*** 1011,1024 **** + char *tmp, *tmp2; + int j, i; + +! if (chkinfnan(p, d, 1) || chkinfnan(p, d, 2)) + return; /* already printed nan or inf */ + + GETLOCALEDATA(decpoint, thoussep, grouping); + DEF_PREC(p); +! j = log_10(d); +! d = d / pow_10(j); /* get the Mantissa */ +! d = ROUND(d, p); + tmp = dtoa(d, p->precision, &tmp2); + + /* 1 for unit, 1 for the '.', 1 for 'e|E', +--- 1027,1045 ---- + char *tmp, *tmp2; + int j, i; + +! if (d != 0 && (chkinfnan(p, d, 1) || chkinfnan(p, d, 2))) + return; /* already printed nan or inf */ + + GETLOCALEDATA(decpoint, thoussep, grouping); + DEF_PREC(p); +! if (d == 0.) +! j = 0; +! else +! { +! j = log_10(d); +! d = d / pow_10(j); /* get the Mantissa */ +! d = ROUND(d, p); +! } + tmp = dtoa(d, p->precision, &tmp2); + + /* 1 for unit, 1 for the '.', 1 for 'e|E', +*************** +*** 1076,1081 **** +--- 1097,1103 ---- + PUT_CHAR(*tmp, p); + tmp++; + } ++ + PAD_LEFT(p); + } + #endif +*************** +*** 1358,1364 **** + STAR_ARGS(data); + DEF_PREC(data); + d = GETDOUBLE(data); +! i = log_10(d); + /* + * for '%g|%G' ANSI: use f if exponent + * is in the range or [-4,p] exclusively +--- 1380,1386 ---- + STAR_ARGS(data); + DEF_PREC(data); + d = GETDOUBLE(data); +! i = (d != 0.) ? log_10(d) : -1; + /* + * for '%g|%G' ANSI: use f if exponent + * is in the range or [-4,p] exclusively +*** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/bash/bash-3.2-doc.patch b/bash/bash-3.2-doc.patch new file mode 100644 index 0000000..9fb0fc4 --- /dev/null +++ b/bash/bash-3.2-doc.patch @@ -0,0 +1,35 @@ +diff -Nru bash-3.0/doc/Makefile.in bash-3.0-new/doc/Makefile.in +--- bash-3.0/doc/Makefile.in 2004-07-27 14:57:48.000000000 +0200 ++++ bash-3.0-new/doc/Makefile.in 2005-02-02 23:29:13.401509336 +0100 +@@ -141,7 +141,7 @@ + ${RM} $@ + -${DVIPS} $< + +-all: ps info dvi text html ++all: + nodvi: ps info text html + + PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps +@@ -220,21 +220,9 @@ + $(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \ + fi + +-install: info installdirs bash.info ++install: installdirs + -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} + -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} +-# uncomment the next line to install the builtins man page +-# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +- -$(INSTALL_DATA) $(srcdir)/bash.info $(DESTDIR)$(infodir)/bash.info +-# run install-info if it is present to update the info directory +- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ +- install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ +- else true; fi +-# if htmldir is set, install the html files into that directory +- -if test -n "${htmldir}" ; then \ +- $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \ +- $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \ +- fi + + uninstall: + -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext}
participants (1)
-
crux@crux.nu