2012-10-28 07:05:44 -04:00
|
|
|
$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(
|
2001-01-02 19:02:55 -05:00
|
|
|
{
|
|
|
|
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
|
2012-10-28 07:05:44 -04:00
|
|
|
@@ -2842,15 +2846,23 @@ GetValueString(
|
2001-01-02 19:02:55 -05:00
|
|
|
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);
|
|
|
|
}
|