diff --git a/builtins/fc.def b/builtins/fc.def index 19583684..6394a629 100644 --- a/builtins/fc.def +++ b/builtins/fc.def @@ -475,7 +475,7 @@ fc_gethnum (command, hlist) HIST_ENTRY **hlist; { int sign, n, clen, rh; - register int i, j, last_hist; + register int i, j, last_hist, real_last; register char *s; sign = 1; @@ -503,6 +503,7 @@ fc_gethnum (command, hlist) if (last_hist < 0) return (-1); + real_last = i; i = last_hist; /* No specification defaults to most recent command. */ diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 72ec06a2..3efcf32d 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -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 diff --git a/tests/array.right b/tests/array.right index 4bcd29af..593ab379 100644 --- a/tests/array.right +++ b/tests/array.right @@ -375,6 +375,8 @@ declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5foo")' declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")' declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4four" [5]="5")' strlen(4four) = 5 +1 2 xx 3 1 2 0 3 +1 2 xx 3 1 2 0 3 -1 2 0 3 +1 2 xx 3