summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-02-08 20:55:38 +0000
committerache <ache@FreeBSD.org>2001-02-08 20:55:38 +0000
commit90521c24f8205b72da8e75c2eac3a07865741d81 (patch)
tree27e32fe73028eab77197886994e62e7aee1f3212
parentd7530cd6666aab2629a125b10daee4aae79fa149 (diff)
downloadFreeBSD-src-90521c24f8205b72da8e75c2eac3a07865741d81.zip
FreeBSD-src-90521c24f8205b72da8e75c2eac3a07865741d81.tar.gz
Hardcode c_fmt in a different way since used in nl_langinfo now
-rw-r--r--lib/libc/stdtime/strftime.c4
-rw-r--r--lib/libc/stdtime/strptime.c4
-rw-r--r--lib/libc/stdtime/timelocal.c5
-rw-r--r--lib/libc/stdtime/timelocal.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 27b0170..2712d95 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -123,8 +123,8 @@ label:
"%02d", pt, ptlim);
continue;
case 'c':
- /* NOTE: c_fmt is intentionally ignored */
- pt = _fmt("%a %Ef %T %Y", t, pt, ptlim);
+ /* NOTE: c_fmt is hardcoded in timelocal.c */
+ pt = _fmt(tptr->c_fmt, t, pt, ptlim);
continue;
case 'D':
pt = _fmt("%m/%d/%y", t, pt, ptlim);
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 7da0b9c..ee32651 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -141,8 +141,8 @@ label:
break;
case 'c':
- /* NOTE: c_fmt is intentionally ignored */
- buf = _strptime(buf, "%a %Ef %T %Y", tm);
+ /* NOTE: c_fmt is hardcoded in timelocal.c */
+ buf = _strptime(buf, tptr->c_fmt, tm);
if (buf == 0)
return 0;
break;
diff --git a/lib/libc/stdtime/timelocal.c b/lib/libc/stdtime/timelocal.c
index 6af3167..81e579a 100644
--- a/lib/libc/stdtime/timelocal.c
+++ b/lib/libc/stdtime/timelocal.c
@@ -82,9 +82,8 @@ static const struct lc_time_T _C_time_locale = {
/*
** c_fmt (ctime-compatible)
- ** Not used, just compatibility placeholder.
*/
- NULL,
+ "%a %Ef %T %Y",
/* am */
"AM",
@@ -246,6 +245,8 @@ set_from_buf(const char *p, int num_lines)
for (ap = (const char **) &_time_localebuf, i = 0;
i < num_lines; ++ap, ++i)
*ap = p += strlen(p) + 1;
+ /* XXX: always overwrite for ctime format parsing compatibility */
+ _time_localebuf.c_fmt = _C_time_locale.c_fmt;
if (num_lines >= LCTIME_SIZE_2)
return;
for (i = 0; i < 12; i++)
diff --git a/lib/libc/stdtime/timelocal.h b/lib/libc/stdtime/timelocal.h
index 4e4dc52..06d650a 100644
--- a/lib/libc/stdtime/timelocal.h
+++ b/lib/libc/stdtime/timelocal.h
@@ -40,7 +40,7 @@ struct lc_time_T {
const char * weekday[7];
const char * X_fmt;
const char * x_fmt;
- const char * c_fmt; /* not used, just compatibility placeholder */
+ const char * c_fmt;
const char * am;
const char * pm;
const char * date_fmt;
OpenPOWER on IntegriCloud