]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20101022 snapshot
authorChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 03:08:43 +0000 (22:08 -0500)
committerChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 03:08:43 +0000 (22:08 -0500)
12 files changed:
CWRU/CWRU.chlog
builtins/cd.def
builtins/trap.def
doc/bash.1
doc/bashref.texi
doc/version.texi
include/chartypes.h
parse.y
po/cs.po
po/ja.po
subst.c
tests/RUN-ONE-TEST

index 95e30415f8c725809c88e1beb6e4947b9ff0cd9d..c00f5381c39b4054972a7d3ed9b60532e8a99296 100644 (file)
@@ -10474,45 +10474,3 @@ execute_cmd.c
          saved_redirects is non-null in the `command exec' case.  Fixes
          sh -c 'command exec; exit 1' hanging bug uncovered by FreeBSD
          sh test cases
-
-                                  10/18
-                                  -----
-subst.c
-       - when in posix mode, shell should not exit if a variable assignment
-         error (e.g., assigning to readonly variable) occurs preceding a
-         command that is not a special builtin.  Fixes bug uncovered by
-         FreeBSD sh test cases
-       - when in posix mode, the ${!?} and ${!#} expansions are not indirect
-         expansions, but posix word expansions involving the `!' variable
-
-parse.y
-       - fix parse_comsub so that it does not skip backslash-newline when
-         parsing a comment
-
-                                  10/19
-                                  -----
-subst.c
-       - fix parameter_brace_expand so that an attempt to use the % or #
-         expansions on an unset variable with -u set will cause a non-
-         interactive shell to abort.  Posix change
-       - fix parameter_brace_expand so that an attempt to use pattern
-         substitution or case modification expansions on an unset variable
-         with -u set will cause and unbound variable error and make a
-         non-interactive shell abort
-       - change parameter_brace_expand_length to return INTMAX_MIN if a
-         positional parameter is unset and -u is set
-       - if parameter_brace_expand_length returns INTMAX_MIN when -u is set,
-         treat it as an unbound variable error and make a non-interactive
-         shell abort.  Posix change
-       - change parameter_brace_expand_length to return INTMAX_MIN if an
-         implicit reference to array[0] is made ${#array} and array[0] is
-         not set when -u is set
-
-                                  10/20
-                                  -----
-builtins/cd.def
-       - Posix 2008 says that if no matching directories are found in $CDPATH,
-         use the directory name passed as an operand and go on.  Posix change
-
-doc/bashref.texi
-       - change Posix mode section with latest additions and removals
index 148c59db26933a802b953a5f8377e5e35d985bae..5526c4dfbfd76d49b4f63b69953cf0617e12c4f5 100644 (file)
@@ -283,7 +283,6 @@ cd_builtin (list)
            free (temp);
        }
 
-#if 0  /* changed for bash-4.2 Posix cd description steps 5-6 */
       /* POSIX.2 says that if `.' does not appear in $CDPATH, we don't
         try the current directory, so we just punt now with an error
         message if POSIXLY_CORRECT is non-zero.  The check for cdpath[0]
@@ -294,7 +293,6 @@ cd_builtin (list)
          builtin_error ("%s: %s", dirname, strerror (ENOENT));
          return (EXECUTION_FAILURE);
        }
-#endif
     }
   else
     dirname = list->word->word;
index 2119f5b3cb818273ffb053d3c0f9e42b506c19f1..9523cfc3ceb1e17c02ed866ee80a90d9f001b296 100644 (file)
@@ -35,11 +35,7 @@ value.  If ARG is the null string each SIGNAL_SPEC is ignored by the
 shell and by the commands it invokes.
 
 If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell.  If
-a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command.  If
-a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a
-script run by the . or source builtins finishes executing.  A SIGNAL_SPEC
-of ERR means to execute ARG each time a command's failure would cause the
-shell to exit when the -e option is enabled.
+a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command.
 
 If no arguments are supplied, trap prints the list of commands associated
 with each signal.
index 9a01d6e613392888473d4154b7b8f7bca34c5946..ad79859255d36d09f73d91689b9f00f66316172a 100644 (file)
@@ -9366,8 +9366,8 @@ is
 .BR RETURN ,
 the command
 .I arg
-is executed each time a shell function or a script executed with
-the \fB.\fP or \fBsource\fP builtins finishes executing.
+is executed each time a shell function or a script executed with the
+\fB.\fP or \fBsource\fP builtins finishes executing.
 .if t .sp 0.5
 .if n .sp 1
 If a
index a299899b5133e16aeddbd955d0f5af820e0f0f78..2f457515b2d91844bfe508b82615c43fc5593e13 100644 (file)
@@ -6694,6 +6694,14 @@ the @sc{posix} standard, and include things like passing incorrect options,
 redirection errors, variable assignment errors for assignments preceding
 the command name, and so on.
 
+@item
+If @env{CDPATH} is set, the @code{cd} builtin will not implicitly
+append the current directory to it.  This means that @code{cd} will
+fail if no valid directory name can be constructed from
+any of the entries in @env{$CDPATH}, even if the a directory with
+the same name as the name given as an argument to @code{cd} exists
+in the current directory.
+
 @item
 A non-interactive shell exits with an error status if a variable
 assignment error occurs when no command name follows the assignment
@@ -6701,11 +6709,6 @@ statements.
 A variable assignment error occurs, for example, when trying to assign
 a value to a readonly variable.
 
-@item
-A non-interactive shell exists with an error status if a variable
-assignment error occurs in an assignment statement preceding a special
-builtin, but not with any other simple command.
-
 @item
 A non-interactive shell exits with an error status if the iteration
 variable in a @code{for} statement or the selection variable in a
@@ -6771,6 +6774,10 @@ constructed from @code{$PWD} and the directory name supplied as an argument
 does not refer to an existing directory, @code{cd} will fail instead of
 falling back to @var{physical} mode.
 
+@item
+When the @code{pwd} builtin is supplied the @option{-P} option, it resets
+@code{$PWD} to a pathname containing no symlinks.
+
 @item
 The @code{pwd} builtin verifies that the value it prints is the same as the
 current directory, even if it is not asked to check the file system with the
index cc4b015c82a456a78b9e6cc5e725d2477faeeee3..a68f5e7969e44008244a5aaf5e7f3cac2b593a8a 100644 (file)
@@ -2,9 +2,9 @@
 Copyright (C) 1988-2010 Free Software Foundation, Inc.
 @end ignore
 
-@set LASTCHANGE Wed Oct 20 21:37:22 EDT 2010
+@set LASTCHANGE Mon Sep  6 22:08:10 EDT 2010
 
 @set EDITION 4.2
 @set VERSION 4.2
-@set UPDATED 20 October 2010
-@set UPDATED-MONTH October 2010
+@set UPDATED 6 September 2010
+@set UPDATED-MONTH September 2010
index 77bcad97677be0eeb0a18f2077812156b88ad090..389d4fd345d4e5d4748407e7c6ea1df359ea5d31 100644 (file)
 #ifndef TOCTRL
    /* letter to control char -- ASCII.  The TOUPPER is in there so \ce and
       \cE will map to the same character in $'...' expansions. */
+   /* XXX - should this be TOUPPER(x) ^ x040 ? */
 #  define TOCTRL(x)    (TOUPPER(x) & 037)
 #endif
 #ifndef UNCTRL
diff --git a/parse.y b/parse.y
index 449f0c67d49255d5246a52a5605287dbcd219997..4760befb267d0517c806afce8baba56a67812fa0 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -3165,7 +3165,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
   start_lineno = line_number;
   while (count)
     {
-      ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0);
+      ch = shell_getc (qc != '\'' && (tflags & LEX_PASSNEXT) == 0);
 
       if (ch == EOF)
        {
@@ -3434,7 +3434,7 @@ parse_comsub (qc, open, close, lenp, flags)
   while (count)
     {
 comsub_readchar:
-      ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0);
+      ch = shell_getc (qc != '\'' && (tflags & LEX_PASSNEXT) == 0);
 
       if (ch == EOF)
        {
index f918a90db3d1fe09382c705215a4e73ae88e6d41..4851c34816621edb942628d2f0719220fe8f64aa 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: bash 4.1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2009-12-30 08:25-0500\n"
-"PO-Revision-Date: 2010-01-03 22:30+0100\n"
+"PO-Revision-Date: 2010-10-18 22:31+0200\n"
 "Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
 "Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
@@ -411,7 +411,7 @@ msgstr "toto není login shell: použijte „exit“"
 #: builtins/exit.def:120
 #, c-format
 msgid "There are stopped jobs.\n"
-msgstr "Jsou zde pozastavení úlohy.\n"
+msgstr "Jsou zde pozastavené úlohy.\n"
 
 #: builtins/exit.def:122
 #, c-format
index 13b1c96084ddfb73b0a77744fd64955ae44de287..3c9a120fb4a5444409109b0d4f31e3418ee1a113 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: GNU bash 4.1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2009-12-30 08:25-0500\n"
-"PO-Revision-Date: 2010-08-19 15:21+0900\n"
+"PO-Revision-Date: 2010-10-17 19:38+0900\n"
 "Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
 "Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
@@ -67,7 +67,7 @@ msgstr "%s: 区切り文字コロン(:)がありません"
 #: builtins/alias.def:132
 #, c-format
 msgid "`%s': invalid alias name"
-msgstr "%s: 無効なエイリアス名です"
+msgstr "`%s': 無効なエイリアス名です"
 
 #: builtins/bind.def:120 builtins/bind.def:123
 msgid "line editing not enabled"
@@ -362,7 +362,7 @@ msgstr "%s: 動的にロードされていません"
 #: builtins/enable.def:474
 #, c-format
 msgid "%s: cannot delete: %s"
-msgstr "%s: %s を削除できません"
+msgstr "%s: 削除できません: %s"
 
 #: builtins/evalfile.c:134 builtins/hash.def:169 execute_cmd.c:4794
 #: shell.c:1452
@@ -389,7 +389,7 @@ msgstr "%s: バイナリファイルを実行できません"
 #: builtins/exec.def:212
 #, c-format
 msgid "%s: cannot execute: %s"
-msgstr "%s: %s を実行できません"
+msgstr "%s: 実行できません: %s"
 
 #: builtins/exit.def:65
 #, c-format
@@ -421,7 +421,7 @@ msgstr "ヒストリ指定"
 #: builtins/fc.def:370
 #, c-format
 msgid "%s: cannot open temp file: %s"
-msgstr "%s: 一時ファイル %s を開くことができません"
+msgstr "%s: 一時ファイルを開くことができません: %s"
 
 #: builtins/fg_bg.def:149 builtins/jobs.def:282
 msgid "current"
@@ -470,7 +470,7 @@ msgstr "`%s' に一致するヘルプ項目がありません。`help help'、`m
 #: builtins/help.def:185
 #, c-format
 msgid "%s: cannot open: %s"
-msgstr "%s: %s を開くことができません"
+msgstr "%s: 開くことができません: %s"
 
 #: builtins/help.def:337
 #, c-format
@@ -534,7 +534,7 @@ msgstr "%s: インデックス配列ではありません"
 #: builtins/mapfile.def:249 builtins/read.def:279
 #, c-format
 msgid "%s: invalid file descriptor specification"
-msgstr "%s: 指定したファイル記述子は無効です"
+msgstr "%s: 無効なファイル記述子指定です"
 
 #: builtins/mapfile.def:257 builtins/read.def:286
 #, c-format
@@ -817,7 +817,7 @@ msgstr "%s は %s です\n"
 #: builtins/type.def:337
 #, c-format
 msgid "%s is hashed (%s)\n"
-msgstr "%s ã\81¯ã\83\8fã\83\83ã\82·ã\83¥ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8b (%s)\n"
+msgstr "%s ã\81¯ã\83\8fã\83\83ã\82·ã\83¥ã\81\95ã\82\8cã\81¦ã\81\84ã\81¾ã\81\99 (%s)\n"
 
 #: builtins/ulimit.def:372
 #, c-format
@@ -827,7 +827,7 @@ msgstr "%s: limit の無効な引数です"
 #: builtins/ulimit.def:398
 #, c-format
 msgid "`%c': bad command"
-msgstr "`%c': 誤った指定です"
+msgstr "`%c': 誤ったコマンドです"
 
 #: builtins/ulimit.def:427
 #, c-format
@@ -900,7 +900,7 @@ msgstr "\a入力待ちがタイムアウトしました: 自動ログアウト\n
 #: execute_cmd.c:497
 #, c-format
 msgid "cannot redirect standard input from /dev/null: %s"
-msgstr "/dev/null ã\82\92å\85¥å\8a\9bã\81«リダイレクトできません: %s"
+msgstr "/dev/null ã\81\8bã\82\89æ¨\99æº\96å\85¥å\8a\9bã\81«å¯¾ã\81\97ã\81¦リダイレクトできません: %s"
 
 #: execute_cmd.c:1162
 #, c-format
@@ -914,7 +914,7 @@ msgstr "パイプエラー"
 #: execute_cmd.c:4481
 #, c-format
 msgid "%s: restricted: cannot specify `/' in command names"
-msgstr "%s: 制限されています:  `/' をコマンド名に指定できません"
+msgstr "%s: å\88¶é\99\90ã\81\95ã\82\8cã\81¦ã\81\84ã\81¾ã\81\99:  `/' ã\82\92ã\82³ã\83\9eã\83³ã\83\89å\90\8dã\81®ä¸­ã\81«æ\8c\87å®\9aã\81§ã\81\8dã\81¾ã\81\9bã\82\93"
 
 #: execute_cmd.c:4572
 #, c-format
@@ -953,7 +953,7 @@ msgstr "0 による除算です"
 
 #: expr.c:471
 msgid "bug: bad expassign token"
-msgstr "bug: 誤った式のトークンです"
+msgstr "バグ: 誤った式のトークンです"
 
 #: expr.c:513
 msgid "`:' expected for conditional expression"
@@ -1038,7 +1038,7 @@ msgstr "add_process: プロセス %5ld (%s) が the_pipeline にあります"
 #: jobs.c:1113
 #, c-format
 msgid "add_process: pid %5ld (%s) marked as still alive"
-msgstr "add_process: pid %5ld (%s) はまだ存在しています"
+msgstr "add_process: pid %5ld (%s) ã\81¯ã\81¾ã\81 å­\98å\9c¨ã\81\97ã\81¦ã\81\84ã\82\8bã\81¨ã\83\9eã\83¼ã\82¯ã\81\95ã\82\8cã\81¦ã\81\84ã\81¾ã\81\99"
 
 #: jobs.c:1401
 #, c-format
@@ -1159,7 +1159,7 @@ msgstr "端末プロセスグループを設定できません (%d)"
 
 #: jobs.c:3682
 msgid "no job control in this shell"
-msgstr "ã\81\93ã\81®ã\82·ã\82§ã\83«ã\81«ã\81¯ã\82¸ã\83§ã\83\96å\88¶å¾¡ã\81\8cã\81\82ã\82\8aã\81¾ã\81\9bã\82\93"
+msgstr "ã\81\93ã\81®ã\82·ã\82§ã\83«ã\81§ã\81¯ã\82¸ã\83§ã\83\96å\88¶å¾¡ã\81\8cç\84¡å\8a¹ã\81«ã\81ªã\81£ã\81¦ã\81\84ã\81¾ã\81\99"
 
 #: lib/malloc/malloc.c:296
 #, c-format
@@ -1172,8 +1172,8 @@ msgid ""
 "\r\n"
 "malloc: %s:%d: assertion botched\r\n"
 msgstr ""
-"\\r\n"
-"malloc: %s:%d: アサーション失敗\\r\n"
+"\r\n"
+"malloc: %s:%d: アサーション失敗\r\n"
 
 #: lib/malloc/malloc.c:313
 msgid "unknown"
@@ -1181,7 +1181,7 @@ msgstr "不明"
 
 #: lib/malloc/malloc.c:797
 msgid "malloc: block on free list clobbered"
-msgstr "malloc: block on free リストにあるブロックが壊れています"
+msgstr "malloc: free ブロックリストが壊れています"
 
 #: lib/malloc/malloc.c:874
 msgid "free: called with already freed block argument"
diff --git a/subst.c b/subst.c
index ea607b40c3850806505a7af0caf4a99382d3e3d0..0b3e062fb2ec209ef39d0dc7491bf41dd550bd3a 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -108,7 +108,7 @@ extern int errno;
 /* Evaluates to 1 if C is one of the shell's special parameters for which an
    indirect variable reference may be made. */
 #define VALID_INDIR_PARAM(c) \
-  ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*')
+  ((c) == '#' || (c) == '?' || (c) == '@' || (c) == '*')
 
 /* Evaluates to 1 if C is one of the OP characters that follows the parameter
    in ${parameter[:]OPword}. */
@@ -5907,7 +5907,7 @@ parameter_brace_expand_length (name)
          break;
        case '!':
          if (last_asynchronous_pid == NO_PID)
-           t = (char *)NULL;   /* XXX - error if set -u set? */
+           t = (char *)NULL;
          else
            t = itos (last_asynchronous_pid);
          break;
@@ -5929,8 +5929,6 @@ parameter_brace_expand_length (name)
       if (legal_number (name + 1, &arg_index))         /* ${#1} */
        {
          t = get_dollar_var_value (arg_index);
-         if (t == 0 && unbound_vars_is_error)
-           return INTMAX_MIN;
          number = MB_STRLEN (t);
          FREE (t);
        }
@@ -5941,8 +5939,6 @@ parameter_brace_expand_length (name)
            t = assoc_reference (assoc_cell (var), "0");
          else
            t = array_reference (array_cell (var), 0);
-         if (t == 0 && unbound_vars_is_error)
-           return INTMAX_MIN;
          number = MB_STRLEN (t);
        }
 #endif
@@ -6944,8 +6940,15 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
   /* If the name really consists of a special variable, then make sure
      that we have the entire name.  We don't allow indirect references
      to special variables except `#', `?', `@' and `*'. */
-  if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) ||
-      (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index])))
+  if ((sindex == t_index &&
+       (string[t_index] == '-' ||
+        string[t_index] == '?' ||
+        string[t_index] == '#')) ||
+      (sindex == t_index - 1 && string[sindex] == '!' &&
+       (string[t_index] == '#' ||
+        string[t_index] == '?' ||
+        string[t_index] == '@' ||
+        string[t_index] == '*')))
     {
       t_index++;
       free (name);
@@ -7040,13 +7043,6 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
        }
 
       number = parameter_brace_expand_length (name);
-      if (number == INTMAX_MIN && unbound_vars_is_error)
-       {
-         last_command_exit_value = EXECUTION_FAILURE;
-         err_unboundvar (name+1);
-         free (name);
-         return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
-       }
       free (name);
 
       *indexp = sindex;
@@ -7182,21 +7178,6 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
 
   *indexp = sindex;
 
-  /* All the cases where an expansion can possibly generate an unbound
-     variable error. */
-  if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE)
-    {
-      if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]))
-       {
-         last_command_exit_value = EXECUTION_FAILURE;
-         err_unboundvar (name);
-         FREE (value);
-         FREE (temp);
-         free (name);
-         return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
-       }
-    }
-    
   /* If this is a substring spec, process it and add the result. */
   if (want_substring)
     {
@@ -7270,6 +7251,15 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
       return &expand_wdesc_error;
 
     case RBRACE:
+      if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]))
+       {
+         last_command_exit_value = EXECUTION_FAILURE;
+         err_unboundvar (name);
+         FREE (value);
+         FREE (temp);
+         free (name);
+         return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
+       }
       break;
 
     case '#':  /* ${param#[#]pattern} */
@@ -9334,7 +9324,6 @@ expand_word_list_internal (list, eflags)
   if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist)
     {
       sh_wassign_func_t *assign_func;
-      int is_special_builtin;
 
       /* If the remainder of the words expand to nothing, Posix.2 requires
         that the variable and environment assignments affect the shell's
@@ -9342,10 +9331,6 @@ expand_word_list_internal (list, eflags)
       assign_func = new_list ? assign_in_env : do_word_assignment;
       tempenv_assign_error = 0;
 
-      /* Posix says that special builtins exit if a variable assignment error
-        occurs in an assignment preceding it. */
-      is_special_builtin = (posixly_correct && new_list && find_special_builtin (new_list->word->word));
-      
       for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next)
        {
          this_command_name = (char *)NULL;
@@ -9359,7 +9344,7 @@ expand_word_list_internal (list, eflags)
              if (assign_func == do_word_assignment)
                {
                  last_command_exit_value = EXECUTION_FAILURE;
-                 if (interactive_shell == 0 && posixly_correct && is_special_builtin)
+                 if (interactive_shell == 0 && posixly_correct)
                    exp_jump_to_top_level (FORCE_EOF);
                  else
                    exp_jump_to_top_level (DISCARD);
index 72ec06a2c1fd8dde92acea5e8ac773e35f1d061b..3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/bash/bash-current
+BUILD_DIR=/usr/local/build/chet/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR