summaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-06-29 08:38:45 +0000
committertruckman <truckman@FreeBSD.org>2002-06-29 08:38:45 +0000
commit477af063c41de1629519c0f6bfbbc6b26cae2c33 (patch)
treeabcec151a181f4d594e53d7d29c10a80fa1e9c81 /math
parent934507dba5dae902f988bf43d2e2cd8a5bd4948c (diff)
downloadFreeBSD-ports-477af063c41de1629519c0f6bfbbc6b26cae2c33.zip
FreeBSD-ports-477af063c41de1629519c0f6bfbbc6b26cae2c33.tar.gz
The format patch included in PR ports/32017 is breaks formats such as
"0.000", trimming trailing non-zeros and adding back trailing zeros. Fix both the original bug, which was caused by walking off the beginning of the fractional part of the value and into the integer part, as well as the new bug, by terminating the trailing zero stripping when the first non-zero character is encountered. Also, correctly calculate the number number of trailing zeros that should potentially be removed if the format contains trailing text characters. Bump PORTREVISION. Reviewed by: send-pr@oldach.net (Helge Oldach)
Diffstat (limited to 'math')
-rw-r--r--math/sc/Makefile2
-rw-r--r--math/sc/files/patch-ae24
2 files changed, 22 insertions, 4 deletions
diff --git a/math/sc/Makefile b/math/sc/Makefile
index c87e52d..e76e1c9 100644
--- a/math/sc/Makefile
+++ b/math/sc/Makefile
@@ -7,7 +7,7 @@
PORTNAME= sc
PORTVERSION= 6.21
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= math
MASTER_SITES= ftp://gatekeeper.dec.com/pub/misc/
EXTRACT_SUFX= .tar.Z
diff --git a/math/sc/files/patch-ae b/math/sc/files/patch-ae
index b45d56d..d9a8146 100644
--- a/math/sc/files/patch-ae
+++ b/math/sc/files/patch-ae
@@ -1,6 +1,15 @@
---- format.c.orig Mon May 11 20:43:34 1992
-+++ format.c Sat Dec 9 21:24:41 2000
-@@ -263,7 +263,6 @@
+--- format.c.orig Mon May 11 11:43:34 1992
++++ format.c Sun Jun 23 19:38:37 2002
+@@ -256,14 +256,14 @@
+
+ case '#':
+ width++;
++ zero_pad++;
+ break;
+
+ case '0':
+- zero_pad = ++width;
++ width++;
break;
}
}
@@ -8,3 +17,12 @@
}
(void) sprintf(prtfmt, "%%.%dlf", width);
(void) sprintf(mantissa, prtfmt, val);
+@@ -281,6 +281,8 @@
+ {
+ if (*cp == '0')
+ *cp = EOS;
++ else
++ break;
+ }
+ }
+
OpenPOWER on IntegriCloud