patches/gmp/4.2.4/110-mpf_set_str.patch
author Johannes Stezenbach <js@sig21.net>
Thu Jul 29 19:30:37 2010 +0200 (2010-07-29)
branch1.7
changeset 2047 ace1d90c9b15
permissions -rw-r--r--
scripts: remove . from $PATH

Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.

If . is in PATH, gcc-4.4.4 build breaks:

[ALL ] checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL ] config.status: creating as

i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 20dd8cef1c8adff0aa3e78ae6d7acfbc45ed5a83)
yann@1250
     1
Original patch from: mpf_set_str.c.4.diff
yann@1250
     2
yann@1250
     3
-= BEGIN original header =-
yann@1250
     4
-= END original header =-
yann@1250
     5
yann@1250
     6
diff -durN gmp-4.2.4.orig/mpf/set_str.c gmp-4.2.4/mpf/set_str.c
yann@1250
     7
--- gmp-4.2.4.orig/mpf/set_str.c	2008-08-25 16:11:37.000000000 +0200
yann@1250
     8
+++ gmp-4.2.4/mpf/set_str.c	2009-03-08 18:36:16.000000000 +0100
yann@1250
     9
@@ -137,7 +137,12 @@
yann@1250
    10
       c = (unsigned char) *++str;
yann@1250
    11
     }
yann@1250
    12
 
yann@1250
    13
+  /* Default base to decimal.  */
yann@1250
    14
+  if (base == 0)
yann@1250
    15
+    base = 10;
yann@1250
    16
+
yann@1250
    17
   exp_base = base;
yann@1250
    18
+
yann@1250
    19
   if (base < 0)
yann@1250
    20
     {
yann@1250
    21
       exp_base = 10;
yann@1250
    22
@@ -165,10 +170,6 @@
yann@1250
    23
 	return -1;
yann@1250
    24
     }
yann@1250
    25
 
yann@1250
    26
-  /* Default base to decimal.  */
yann@1250
    27
-  if (base == 0)
yann@1250
    28
-    base = 10;
yann@1250
    29
-
yann@1250
    30
   /* Locate exponent part of the input.  Look from the right of the string,
yann@1250
    31
      since the exponent is usually a lot shorter than the mantissa.  */
yann@1250
    32
   expptr = NULL;