[evolution-data-server] Making the win32 conversion of GetLocaleInfo images to strftime format
- From: Fridrich Strba <strba src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-data-server] Making the win32 conversion of GetLocaleInfo images to strftime format
- Date: Fri, 3 Jul 2009 15:51:51 +0000 (UTC)
commit f94dbd0210a494ce7be145b5c030fcf9aa58ecc7
Author: Fridrich Strba <fridrich strba bluewin ch>
Date: Fri Jul 3 17:50:41 2009 +0200
Making the win32 conversion of GetLocaleInfo images to strftime format
string actually work.
libedataserver/e-time-utils.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 1551624..8a90441 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -2025,9 +2025,9 @@ e_localtime_with_offset (time_t tt, struct tm *tm, gint *offset)
}
#ifdef G_OS_WIN32
-static int _e_string_replace(gchar *s, const gchar *old, const gchar *new)
+static int _e_string_replace(gchar *str, const gchar *old, const gchar *new)
{
- char *buf;
+ gchar *buf, *s = str;
int i, count = 0;
size_t newlen = strlen(new);
size_t oldlen = strlen(old);
@@ -2052,10 +2052,10 @@ static int _e_string_replace(gchar *s, const gchar *old, const gchar *new)
} else
buf[i++] = *s++;
}
- buf[i] = '\0';
-
- g_free(s);
- s = buf;
+
+ g_free(str);
+ str = g_strdup(buf);
+ g_free(buf);
return 0;
}
#endif
@@ -2071,9 +2071,9 @@ e_time_get_d_fmt_with_4digit_year (void)
int format_string_length = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, NULL, 0);
if (format_string_length > 0)
{
+ gsize format_bytes_read, format_bytes_written;
gchar *format_string = g_strnfill(format_string_length + 1, '\0');
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, format_string, format_string_length);
- gsize format_bytes_read, format_bytes_written;
res = g_locale_to_utf8(format_string, format_string_length, &format_bytes_read, &format_bytes_written, NULL);
g_free(format_string);
/* now, convert the res to format of nl_langinfo */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]