[Top][All Lists]

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

Bash 2.05 misc subst.c fixes for 64-bit hosts

From: Paul Eggert
Subject: Bash 2.05 misc subst.c fixes for 64-bit hosts
Date: Sun, 29 Apr 2001 17:27:42 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: cc -xarch=v9
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' 
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7' 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I.. -I../include -I../lib 
-I/tmp/prefix/include -g
uname output: SunOS sic.twinsun.com 5.7 Generic_106541-15 sun4u sparc 
Machine Type: sparc-sun-solaris2.7

Bash Version: 2.05
Patch Level: 0
Release Status: release

        Here are some other miscellaneous fixes for subst.c on 64-bit
        hosts, to fix a few other places where the code incorrectly
        truncates 'long' values to 'int'.  These fixes assume my
        earlier patches.



2001-04-29  Paul Eggert  <address@hidden>

        * subst.h (sub_append_number): Now takes 'long', not 'int'.

        * subst.c (sub_append_number): Number is 'long', not 'int'.
        (array_length_reference): Return arrayind_t, not 'int'.
        (parameter_brace_expand_length): Return 'long', not 'int.
        (parameter_brace_expand, param_expand): Compute Bash numbers using
        'long', not 'int'.
        (expand_word_internal): Remove unused number var that was of the
        wrong type (it was 'int' but should have been 'long').

RCS file: subst.h,v
retrieving revision
retrieving revision
diff -pu -r2.5.0.2 -r2.5.0.3
--- subst.h     2001/04/29 23:39:20
+++ subst.h     2001/04/30 00:20:51
@@ -103,7 +103,7 @@ extern char *sub_append_string __P((char
 /* Append the textual representation of NUMBER to TARGET.
    INDEX and SIZE are as in SUB_APPEND_STRING. */
-extern char *sub_append_number __P((int, char *, int *, int *));
+extern char *sub_append_number __P((long, char *, int *, int *));
 /* Return the word list that corresponds to `$*'. */
 extern WORD_LIST *list_rest_of_args __P((void));
RCS file: subst.c,v
retrieving revision
retrieving revision
diff -pu -r2.5.0.6 -r2.5.0.7
--- subst.c     2001/04/29 23:39:20
+++ subst.c     2001/04/30 00:20:51
@@ -386,7 +386,8 @@ sub_append_string (source, target, indx,
    INDX and SIZE are as in SUB_APPEND_STRING. */
 char *
 sub_append_number (number, target, indx, size)
-     int number, *indx, *size;
+     long number;
+     int *indx, *size;
      char *target;
   char *temp;
@@ -3790,7 +3791,7 @@ get_array_value (s, allow_all)
   return (array_value_internal (s, 0, allow_all));
-static int
+static arrayind_t
 array_length_reference (s)
      char *s;
@@ -4068,12 +4069,12 @@ valid_length_expression (name)
 /* Handle the parameter brace expansion that requires us to return the
    length of a parameter. */
-static int
+static long
 parameter_brace_expand_length (name)
      char *name;
   char *t, *newname;
-  int number;
+  long number;
   long arg_index;
   WORD_LIST *list;
 #if defined (ARRAY_VARS)
@@ -4627,7 +4628,8 @@ parameter_brace_expand (string, indexp, 
   int check_nullness, var_is_set, var_is_null, var_is_special;
   int want_substring, want_indir, want_patsub;
   char *name, *value, *temp, *temp1;
-  int t_index, sindex, c, number;
+  int t_index, sindex, c;
+  long number;
   value = (char *)NULL;
   var_is_set = var_is_null = var_is_special = check_nullness = 0;
@@ -4985,7 +4987,8 @@ param_expand (string, sindex, quoted, ex
      int *quoted_dollar_at_p, *had_quoted_null_p, pflags;
   char *temp, *temp1;
-  int zindex, number, c, t_index, expok;
+  int zindex, c, t_index, expok;
+  long number;
   SHELL_VAR *var;
   WORD_LIST *list, *tlist;
@@ -5352,7 +5355,6 @@ expand_word_internal (word, quoted, isex
   int tflag;
   register int c;              /* Current character. */
-  int number;                  /* Temporary number value. */
   int t_index;                 /* For calls to string_extract_xxx. */
   char ifscmap[256];

reply via email to

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