bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typo in 'verify_substring_values()' in subst.c


From: William Park
Subject: Typo in 'verify_substring_values()' in subst.c
Date: Thu, 20 Feb 2003 13:59:42 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -g 
-O4 -march=i686
uname output: Linux node1 2.4.20 #1 SMP Fri Jan 17 15:48:54 EST 2003 i686 
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 4
Release Status: release

Description:

    Typo -- Array starts from 0 to N-1, so if N is the number of elements,
            then N'th item is the position after the last element.  This is
            the same as "string".  No need to offset by 1 like positional
            parameter, where it goes from 1 to N, so the the position after
            the last item is N+1.

Fix:

--- bash-2.05b/subst.c  Thu Feb 20 13:12:14 2003
+++ bash/subst.c        Thu Feb 20 13:27:29 2003
@@ -4359,7 +4359,7 @@
 #if defined (ARRAY_VARS)
     case VT_ARRAYVAR:
       a = (ARRAY *)value;
-      len = array_num_elements (a) + 1;
+      len = array_num_elements (a);
       break;
 #endif
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]