]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20100129 snapshot
authorChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 02:53:29 +0000 (21:53 -0500)
committerChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 02:53:29 +0000 (21:53 -0500)
12 files changed:
CWRU/CWRU.chlog
CWRU/CWRU.chlog~
MANIFEST
Makefile.in
autom4te.cache/requests
bashline.c
bashline.c~
parse.y
tests/RUN-ONE-TEST
tests/arith.right
tests/arith.tests
tests/arith3.sub [new file with mode: 0644]

index f015b4dd549e63fece9aa31acd8354bebaa6e21e..fefe32d1790c12fbc5c1d7abbe152effdace2203 100644 (file)
@@ -9457,3 +9457,12 @@ arrayfunc.c
          invisible.  Pointed out by Mart Frauenlab <mart.frauenlob@chello.at>
        - change array_value_internal to return NULL for variable which has
          not been set
+
+                                  1/30
+                                  ----
+bashline.c
+       - in command_word_completion_function, don't call glob_pattern_p
+         on hint -- use the already-computed `globpat'.  At this point,
+         hint might contain an already-dequoted globbing character, but
+         glob_matches will be NULL.  Fixes bug reported by
+         coyote@wariat.org.pl
index 6230712d4d469fe4a1af231449bae238abcbeec8..f015b4dd549e63fece9aa31acd8354bebaa6e21e 100644 (file)
@@ -9455,3 +9455,5 @@ builtins/setattr.def
 arrayfunc.c
        - fix array_keys to return NULL if the variable is not set or
          invisible.  Pointed out by Mart Frauenlab <mart.frauenlob@chello.at>
+       - change array_value_internal to return NULL for variable which has
+         not been set
index 6b9e9f2971f26a5a0af6a2844ab319970c12684e..ffc26faeb339cd8456671749202eaea67b097478 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -743,6 +743,7 @@ tests/arith.tests   f
 tests/arith.right      f
 tests/arith1.sub       f
 tests/arith2.sub       f
+tests/arith3.sub       f
 tests/array.tests      f
 tests/array.right      f
 tests/array1.sub       f
index f01d49c7ca06fbd02faf6c9c3b0d13ea1709cb9d..dbdc27d2e7ae57bdd23a5f886b02a0b2b3794e2c 100644 (file)
@@ -1184,7 +1184,7 @@ jobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 mailcheck.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 make_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
-parse.y: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
+y.tab.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 pcomplete.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 pcomplib.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 print_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
index 4a5e08c959e79308e600ade061bffe6a5fcb00af..014c1526793ccc20fe5014394befba83e8496a78 100644 (file)
                         'configure.in'
                       ],
                       {
-                        '_LT_AC_TAGCONFIG' => 1,
                         'AM_PROG_F77_C_O' => 1,
-                        'AC_INIT' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
                         'm4_pattern_forbid' => 1,
-                        '_AM_COND_IF' => 1,
+                        'AC_INIT' => 1,
                         'AC_CANONICAL_TARGET' => 1,
-                        'AC_SUBST' => 1,
+                        '_AM_COND_IF' => 1,
                         'AC_CONFIG_LIBOBJ_DIR' => 1,
-                        'AC_FC_SRCEXT' => 1,
+                        'AC_SUBST' => 1,
                         'AC_CANONICAL_HOST' => 1,
+                        'AC_FC_SRCEXT' => 1,
                         'AC_PROG_LIBTOOL' => 1,
                         'AM_INIT_AUTOMAKE' => 1,
                         'AC_CONFIG_SUBDIRS' => 1,
                         'AM_AUTOMAKE_VERSION' => 1,
                         'LT_CONFIG_LTDL_DIR' => 1,
-                        'AC_REQUIRE_AUX_FILE' => 1,
                         'AC_CONFIG_LINKS' => 1,
-                        'm4_sinclude' => 1,
+                        'AC_REQUIRE_AUX_FILE' => 1,
                         'LT_SUPPORTED_TAG' => 1,
+                        'm4_sinclude' => 1,
                         'AM_MAINTAINER_MODE' => 1,
                         'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
                         '_m4_warn' => 1,
                         'AC_CANONICAL_BUILD' => 1,
                         'AC_FC_FREEFORM' => 1,
                         'AH_OUTPUT' => 1,
-                        '_AM_SUBST_NOTMAKE' => 1,
                         'AC_CONFIG_AUX_DIR' => 1,
-                        'sinclude' => 1,
-                        'm4_pattern_allow' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
                         'AM_PROG_CC_C_O' => 1,
-                        'AC_CANONICAL_SYSTEM' => 1,
+                        'm4_pattern_allow' => 1,
+                        'sinclude' => 1,
                         'AM_CONDITIONAL' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
                         'AC_CONFIG_HEADERS' => 1,
                         'AC_DEFINE_TRACE_LITERAL' => 1,
                         'm4_include' => 1,
index 345c5755d62972d1f9a6228dc5745f85bad21746..6164bc6fa844c4e60efbf36720dfb78e78dce2f5 100644 (file)
@@ -1680,7 +1680,7 @@ globword:
      a single match (multiple matches that end up reducing the number of
      characters in the common prefix are bad) will ever be returned on
      regular completion. */
-  if (glob_pattern_p (hint))
+  if (globpat)
     {
       if (state == 0)
        {
index 4d0a1cbf03cfea83b1532eff35987a31bbc1c734..3654cee85f0b4da94bd3f4c3a66966c4baab9552 100644 (file)
@@ -1680,7 +1680,11 @@ globword:
      a single match (multiple matches that end up reducing the number of
      characters in the common prefix are bad) will ever be returned on
      regular completion. */
+#if 1
+  if (globpat)
+#else
   if (glob_pattern_p (hint))
+#endif
     {
       if (state == 0)
        {
@@ -3421,7 +3425,10 @@ static int
 putx(c)
      int c;
 {
-  return (putc (c, rl_outstream));
+  int x;
+
+  x = putc (c, rl_outstream);
+  return (x);
 }
   
 static int
diff --git a/parse.y b/parse.y
index f8f00c472251b94f86f96bf3b642d31e87e5ecf6..3edf7cceca9355f0dfdda86e6102bb5e15474f7e 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -3340,6 +3340,14 @@ parse_comsub (qc, open, close, lenp, flags)
   char *ret, *nestret, *ttrans, *heredelim;
   int retind, retsize, rflags, hdlen;
 
+#if 0  /* XXX - bash-4.2 -- jwm@horde.net */
+  /* Assume $(( introduces arithmetic command and parse accordingly. */
+  peekc = shell_getc (0);
+  shell_ungetc (peekc);
+  if (peekc == '(')
+    return (parse_matched_pair (qc, open, close, lenp, 0));
+#endif
+
 /*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/
   count = 1;
   tflags = LEX_RESWDOK;
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
 
index 51d740e49232256fd692ebe5b6f141e843e4de13..41e2654b8ba86a479ce1cfe27858ac1a5959053a 100644 (file)
@@ -191,14 +191,23 @@ ok
 -7
 7
 7
+1
+1
+4
+5
+-3
+2
+4
+10000
+10000
 8 12
-./arith.tests: line 274: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
-./arith.tests: line 278: a b: syntax error in expression (error token is "b")
-./arith.tests: line 279: ((: a b: syntax error in expression (error token is "b")
+./arith.tests: line 275: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
+./arith.tests: line 279: a b: syntax error in expression (error token is "b")
+./arith.tests: line 280: ((: a b: syntax error in expression (error token is "b")
 42
 42
 42
 42
 42
 42
-./arith.tests: line 290: b[c]d: syntax error in expression (error token is "d")
+./arith.tests: line 291: b[c]d: syntax error in expression (error token is "d")
index 9e82bb1db485418b6f9e1dcb0996f8e8e27320ef..21bfdca4c800d3dc831b88787918cbd778ad309b 100644 (file)
@@ -262,6 +262,7 @@ echo $(( --7 ))
 
 ${THIS_SH} ./arith1.sub
 ${THIS_SH} ./arith2.sub
+${THIS_SH} ./arith3.sub
 
 x=4
 y=7
diff --git a/tests/arith3.sub b/tests/arith3.sub
new file mode 100644 (file)
index 0000000..e846447
--- /dev/null
@@ -0,0 +1,45 @@
+RANDOM=42
+(( dice[RANDOM%6+1 + RANDOM%6+1]++ ))
+echo ${dice[5]}
+
+(( ++dice[RANDOM%6+1 + RANDOM%6+1] ))
+echo ${dice[6]}
+
+v=4
+DIND=20
+
+(( dice[DIND%6 + 1]=v ))
+echo ${dice[3]}
+
+RANDOM=42
+
+(( dice[RANDOM%6+1 + RANDOM%6+1]+=v ))
+echo ${dice[5]}
+
+(( dice[RANDOM%6+1 + RANDOM%6+1]-=v ))
+echo ${dice[6]}
+
+(( dice[RANDOM%6+1 + RANDOM%6+1]+=2 ))
+echo ${dice[11]}
+
+(( dice[RANDOM%6+1 + RANDOM%6+1]*=2 ))
+echo ${dice[11]}
+
+unset dice1 dice2
+RANDOM=42
+
+for i in {1..10000}; do ((dice1[$RANDOM%6+1 + $RANDOM%6+1]++)); done;
+unset t; for i in ${dice1[@]}; do ((t+=i)); done; echo $t
+
+foo="${dice1[@]}"
+
+RANDOM=42
+
+for i in {1..10000}; do ((dice2[RANDOM%6+1 + RANDOM%6+1]++)); done;
+unset t; for i in ${dice2[@]}; do ((t+=i)); done; echo $t
+
+bar="${dice2[@]}"
+
+if [ "$foo" != "$bar" ]; then
+       echo "random sequences differ"
+fi