delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2008/05/30/08:01:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX18KMLohWtYKoDw4Qp2v103IGYe0qs+nawf8h6eSaA
5IwxlfFqYXyaVy
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: Implementing 'E' and 'O' modifiers in strftime.
Date: Fri, 30 May 2008 13:47:51 +0200
User-Agent: KMail/1.9.5
MIME-Version: 1.0
Message-Id: <200805301347.52527.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

While I was trying to implement strptime, I have noticed that strftime does not
support the 'E' and 'O' conversion modifiers of the conversion specifiers.  If
the locale is "C" the modifiers shall be ignored.  Because djgpp only supports
"C" locale, both will simply be ignored.

Objections?  Wording in documentation OK?

Regards,
Juan M. Guerrero




2008-05-30  Juan Manuel Guerrero  <juan DOT guerrero AT gmx DOT de>
	Diffs against djgpp CVS head of 2008-04-25.


	* src/libc/ansi/time/strftime.c: Ignore 'E' and 'O' modifiers.

	* src/libc/ansi/time/strftime.txi: Document that 'E' and 'O' modifiers
	are ignored because only C locale is supported.

	* src/docs/kb/wc204.txi: Info about 'E' and 'O' modifiers added.






diff -aprNU3 djgpp.orig/src/docs/kb/wc204.txi djgpp/src/docs/kb/wc204.txi
--- djgpp.orig/src/docs/kb/wc204.txi	2008-05-01 00:45:48 +0000
+++ djgpp/src/docs/kb/wc204.txi	2008-05-30 13:07:20 +0000
@@ -1143,3 +1143,7 @@ family of functions.
 The @code{%n$} and @code{*m$} numeric conversion specifiers
 are now supported by @code{_doprnt} and the @code{printf}
 family of functions.
+
+@findex strftime AT r{, and C99 conversion modifiers}
+The modifiers @code{%}@code{E} and @code{%}@code{O} of the conversion specifiers
+are ignored because djgpp only supports C/POSIX locale.
diff -aprNU3 djgpp.orig/src/libc/ansi/time/strftime.c djgpp/src/libc/ansi/time/strftime.c
--- djgpp.orig/src/libc/ansi/time/strftime.c	2003-11-08 12:19:40 +0000
+++ djgpp/src/libc/ansi/time/strftime.c	2008-05-30 12:59:16 +0000
@@ -78,6 +78,8 @@ _fmt(const char *format, const struct tm
 	pad = space = '0', format++;
       if (format[1] == '^')
 	upcase = 1, format++;
+      if (format[1] == 'E' || format[1] == 'O')
+	format++;  /*  Only C/POSIX locale is supported.  */
 
       switch(*++format)
       {
diff -aprNU3 djgpp.orig/src/libc/ansi/time/strftime.txh djgpp/src/libc/ansi/time/strftime.txh
--- djgpp.orig/src/libc/ansi/time/strftime.txh	2003-11-08 12:19:40 +0000
+++ djgpp/src/libc/ansi/time/strftime.txh	2008-05-30 12:59:14 +0000
@@ -47,6 +47,11 @@ Short for @code{%a %b %e %H:%M:%S %Y} (@
 
 Short for @code{%m/%d/%y %H:%M:%S} (@code{10/01/93 15:30:34})
 
+@item %Ex
+In some locales, the @code{E} modifier selects alternative representations of
+certain conversion specifiers @code{x}.  But in the "C" locale supported by djgpp,
+it is ignored, and treated as @code{%x}.
+
 @item %e
 
 The day of the month, blank padded to two characters (@code{ 2})
@@ -91,6 +96,11 @@ The month (1-12), zero padded to two cha
 
 A newline (@code{\n})
 
+@item %Ox
+In some locales, the @code{O} modifier selects alternative digit characters
+for certain conversion specifiers @code{x}.  But in the "C" locale supported by djgpp,
+it is ignored, and treated as @code{%x}.
+
 @item %p
 
 AM or PM (@code{PM})

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019