X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrftime.c;h=fff5d38eaeca6ce298e8d1f03431713a17bfb654;hb=ce8d6d06c84df409ebb0d71478a122f48cff3dc6;hp=41b35113a04f3c93043d3a6f59345c7606f909a8;hpb=2c15946a4febfa823fef6828d15cba023e66c2c1;p=gnulib.git
diff --git a/lib/strftime.c b/lib/strftime.c
index 41b35113a..fff5d38ea 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -18,19 +18,18 @@
along with this program. If not, see . */
#ifdef _LIBC
-# define HAVE_MBLEN 1
-# define HAVE_MBRLEN 1
# define HAVE_STRUCT_ERA_ENTRY 1
# define HAVE_TM_GMTOFF 1
# define HAVE_TM_ZONE 1
# define HAVE_TZNAME 1
# define HAVE_TZSET 1
-# define MULTIBYTE_IS_FORMAT_SAFE 1
# include "../locale/localeinfo.h"
#else
# include
# if FPRINTFTIME
# include "fprintftime.h"
+# else
+# include "strftime.h"
# endif
#endif
@@ -44,10 +43,16 @@ extern char *tzname[];
/* Do multibyte processing if multibytes are supported, unless
multibyte sequences are safe in formats. Multibyte sequences are
safe if they cannot contain byte sequences that look like format
- conversion specifications. The GNU C Library uses UTF8 multibyte
- encoding, which is safe for formats, but strftime.c can be used
- with other C libraries that use unsafe encodings. */
-#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
+ conversion specifications. The multibyte encodings used by the
+ C library on the various platforms (UTF-8, GB2312, GBK, CP936,
+ GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949,
+ SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%'
+ cannot occur in a multibyte character except in the first byte.
+ But this does not hold for the DEC-HANYU encoding used on OSF/1. */
+#if !defined __osf__
+# define MULTIBYTE_IS_FORMAT_SAFE 1
+#endif
+#define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE)
#if DO_MULTIBYTE
# include