2001-05-29 Dave Peticolas <dave@krondo.com>

* src/engine/date.c: handle all uses of nl_langinfo.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4332 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-05-29 20:00:40 +00:00
parent 19c5c4fba8
commit 11423a3076
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2001-05-29 Dave Peticolas <dave@krondo.com>
* src/engine/date.c: handle all uses of nl_langinfo.
2001-05-30 Robert Graham Merkel <rgmerk@mira.net>
* src/engine/date.c (printDate): Workaround for

View File

@ -31,7 +31,11 @@
#include "config.h"
#include <ctype.h>
#ifdef HAVE_LANGINFO_D_FMT
#include <langinfo.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -44,6 +48,12 @@
#define NANOS_PER_SECOND 1000000000
#ifdef HAVE_LANGINFO_D_FMT
# define GNC_D_FMT (nl_langinfo (D_FMT))
#else
# define GNC_D_FMT "%Y-%m-%d"
#endif
/* This is now user configured through the gnome options system() */
static DateFormat dateFormat = DATE_FORMAT_US;
@ -228,7 +238,7 @@ printDate (char * buff, int day, int month, int year)
tm_str.tm_sec = 0;
tm_str.tm_isdst = -1;
strftime (buff, MAX_DATE_LENGTH, nl_langinfo (D_FMT), &tm_str);
strftime (buff, MAX_DATE_LENGTH, GNC_D_FMT, &tm_str);
}
break;
@ -331,7 +341,7 @@ scanDate (const char *buff, int *day, int *month, int *year)
{
struct tm thetime;
strptime (buff, nl_langinfo (D_FMT), &thetime);
strptime (buff, GNC_D_FMT, &thetime);
iday = thetime.tm_mday;
imonth = thetime.tm_mon + 1;
@ -405,7 +415,7 @@ char dateSeparator ()
secs = time(NULL);
tm = localtime(&secs);
strftime(string, sizeof(string), nl_langinfo (D_FMT), tm);
strftime(string, sizeof(string), GNC_D_FMT, tm);
for (s = string; s != '\0'; s++)
if (!isdigit(*s))