6b69e3097d
"Motif 2.3.4 is an updated version of Open Motif 2.3 and is a major bug fix release." Keeping current package naming (openmotif) for now. Feedback from pascal@ naddy@
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
$OpenBSD: patch-lib_Xm_Scale_c,v 1.2 2012/10/28 11:05:45 sthen Exp $
|
|
--- lib/Xm/Scale.c.orig Mon Oct 22 15:50:34 2012
|
|
+++ lib/Xm/Scale.c Wed Oct 24 21:19:02 2012
|
|
@@ -2834,7 +2834,11 @@ GetValueString(
|
|
{
|
|
register int i;
|
|
int diff, dec_point_size;
|
|
+#ifndef X_LOCALE
|
|
struct lconv *loc_values;
|
|
+#else
|
|
+ char *decimal_point = ".";
|
|
+#endif
|
|
|
|
if (sw->scale.decimal_points > 0) {
|
|
/* Add one to decimal points to get leading zero, since
|
|
@@ -2842,15 +2846,23 @@ GetValueString(
|
|
sprintf (buffer,"%.*d", sw->scale.decimal_points+1, value);
|
|
|
|
diff = strlen(buffer) - sw->scale.decimal_points;
|
|
+#ifndef X_LOCALE
|
|
loc_values = localeconv();
|
|
dec_point_size = strlen(loc_values->decimal_point);
|
|
+#else
|
|
+ dec_point_size = 1;
|
|
+#endif
|
|
|
|
for (i = strlen(buffer); i >= diff; i--)
|
|
buffer[i+dec_point_size] = buffer[i];
|
|
|
|
for (i=0; i<dec_point_size; i++)
|
|
- buffer[diff+i] = loc_values->decimal_point[i];
|
|
-
|
|
+ buffer[diff+i] =
|
|
+#ifndef X_LOCALE
|
|
+ loc_values->decimal_point[i];
|
|
+#else
|
|
+ decimal_point[i];
|
|
+#endif
|
|
} else
|
|
sprintf (buffer,"%d", value);
|
|
}
|