diff options
author | Jari Aalto <jari.aalto@cante.net> | 2001-11-13 17:56:06 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:54 +0000 |
commit | f73dda092b33638d2d5e9c35375f687a607b5403 (patch) | |
tree | f21584e70a444d6a1ecba0fb5e2cf79e8cce91db /bracecomp.c | |
parent | 28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff) | |
download | android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2 android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip |
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'bracecomp.c')
-rw-r--r-- | bracecomp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bracecomp.c b/bracecomp.c index 675e041..323b794 100644 --- a/bracecomp.c +++ b/bracecomp.c @@ -39,8 +39,6 @@ #include "shell.h" #include <readline/readline.h> -extern char *sh_backslash_quote (); - /* Find greatest common prefix of two strings. */ static int string_gcd (s1, s2) @@ -78,7 +76,7 @@ really_munge_braces (array, real_start, real_end, gcd_zero) return x; } - result = xmalloc (result_size = 16); + result = (char *)xmalloc (result_size = 16); *result = '\0'; for (start = real_start; start < real_end; start = end + 1) @@ -102,7 +100,7 @@ really_munge_braces (array, real_start, real_end, gcd_zero) /* In this case, add in a leading '{', because we are at top level, and there isn't a consistent prefix. */ result_size += 1; - result = xrealloc (result, result_size); + result = (char *)xrealloc (result, result_size); result[0] = '{'; result[1] = '\0'; flag++; } @@ -121,13 +119,13 @@ really_munge_braces (array, real_start, real_end, gcd_zero) /* If there is more than one element in the subarray, insert the (quoted) prefix and an opening brace. */ tlen = gcd - gcd_zero; - x = xmalloc (tlen + 1); + x = (char *)xmalloc (tlen + 1); strncpy (x, array[start] + gcd_zero, tlen); x[tlen] = '\0'; subterm = sh_backslash_quote (x); free (x); result_size += strlen (subterm) + 1; - result = xrealloc (result, result_size); + result = (char *)xrealloc (result, result_size); strcat (result, subterm); free (subterm); strcat (result, "{"); @@ -136,7 +134,7 @@ really_munge_braces (array, real_start, real_end, gcd_zero) } result_size += strlen (subterm) + 1; - result = xrealloc (result, result_size); + result = (char *)xrealloc (result, result_size); strcat (result, subterm); strcat (result, ","); free (subterm); |