[PATCH] nautilus-vcs: use the C locale for LC_TIME with strftime
- From: Boris de Laage <bdelaage free fr>
- To: nautilus-list gnome org
- Subject: [PATCH] nautilus-vcs: use the C locale for LC_TIME with strftime
- Date: Sat, 24 Jun 2006 02:46:54 +0200
strftime formats the string according to the current locale, while CVS
timestamps are in english.
This patch changes the LC_TIME locale before calling strftime.
Boris.
Index: nautilus-cvs.c
===================================================================
RCS file: /cvs/gnome/nautilus-vcs/src/nautilus-cvs.c,v
retrieving revision 1.8
diff -u -r1.8 nautilus-cvs.c
--- nautilus-cvs.c 19 Nov 2004 18:18:19 -0000 1.8
+++ nautilus-cvs.c 6 Dec 2005 16:29:12 -0000
@@ -128,8 +128,11 @@
struct tm mtime;
const GnomeVFSFileInfo *info;
char timestamp[512];
+ char *locale;
+
info = nautilus_file_info_get_vfs_file_info (file);
+ locale = setlocale(LC_TIME, "C");
gmtime_r (&info->mtime, &mtime);
if (strftime (timestamp, 512,
"%a %b %e %H:%M:%S %Y",
@@ -138,6 +141,7 @@
ret = TRUE;
}
}
+ setlocale(LC_TIME, locale);
}
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]