comparison src/editfns.c @ 4834:b3ea9c582280

Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
author Ben Wing <ben@xemacs.org>
date Tue, 12 Jan 2010 01:38:04 -0600
parents d261888e5069
children 755ae5b97edb 6ef8256a020a 19a72041c5ed
comparison
equal deleted inserted replaced
4833:4dd2389173fc 4834:b3ea9c582280
1072 1072
1073 *buf = 1; 1073 *buf = 1;
1074 1074
1075 /* !!#### this use of external here is not totally safe, and 1075 /* !!#### this use of external here is not totally safe, and
1076 potentially data lossy. */ 1076 potentially data lossy. */
1077 LISP_STRING_TO_EXTERNAL (format_string, formext, Qnative); 1077 LISP_STRING_TO_EXTERNAL (format_string, formext,
1078 Qtime_function_encoding);
1078 if (emacs_strftime (buf, size, formext, &tm) 1079 if (emacs_strftime (buf, size, formext, &tm)
1079 || !*buf) 1080 || !*buf)
1080 return build_ext_string (buf, Qnative); 1081 return build_ext_string (buf, Qtime_function_encoding);
1081 /* If buffer was too small, make it bigger. */ 1082 /* If buffer was too small, make it bigger. */
1082 size *= 2; 1083 size *= 2;
1083 } 1084 }
1084 } 1085 }
1085 1086
1185 Extbyte tzbuf[100]; 1186 Extbyte tzbuf[100];
1186 Extbyte *tzstring; 1187 Extbyte *tzstring;
1187 Extbyte **oldenv = environ, **newenv; 1188 Extbyte **oldenv = environ, **newenv;
1188 1189
1189 if (STRINGP (zone)) 1190 if (STRINGP (zone))
1190 LISP_STRING_TO_EXTERNAL (zone, tzstring, Qnative); 1191 LISP_STRING_TO_EXTERNAL (zone, tzstring, Qtime_zone_encoding);
1191 else if (INTP (zone)) 1192 else if (INTP (zone))
1192 { 1193 {
1193 int abszone = abs (XINT (zone)); 1194 int abszone = abs (XINT (zone));
1194 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0), 1195 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0),
1195 abszone / (60*60), (abszone/60) % 60, abszone % 60); 1196 abszone / (60*60), (abszone/60) % 60, abszone % 60);
1317 if (t->tm_isdst == 0 || t->tm_isdst == 1) 1318 if (t->tm_isdst == 0 || t->tm_isdst == 1)
1318 s = tzname[t->tm_isdst]; 1319 s = tzname[t->tm_isdst];
1319 #endif 1320 #endif
1320 #endif /* not HAVE_TM_ZONE */ 1321 #endif /* not HAVE_TM_ZONE */
1321 if (s) 1322 if (s)
1322 tem = build_ext_string (s, Qnative); 1323 tem = build_ext_string (s, Qtime_zone_encoding);
1323 else 1324 else
1324 { 1325 {
1325 Ibyte buf[6]; 1326 Ibyte buf[6];
1326 1327
1327 /* No local time zone name is available; use "+-NNNN" instead. */ 1328 /* No local time zone name is available; use "+-NNNN" instead. */
1431 if (NILP (tz)) 1432 if (NILP (tz))
1432 tzstring = 0; 1433 tzstring = 0;
1433 else 1434 else
1434 { 1435 {
1435 CHECK_STRING (tz); 1436 CHECK_STRING (tz);
1436 LISP_STRING_TO_EXTERNAL (tz, tzstring, Qnative); 1437 LISP_STRING_TO_EXTERNAL (tz, tzstring, Qtime_zone_encoding);
1437 } 1438 }
1438 1439
1439 set_time_zone_rule (tzstring); 1440 set_time_zone_rule (tzstring);
1440 if (environbuf) 1441 if (environbuf)
1441 xfree (environbuf, Extbyte **); 1442 xfree (environbuf, Extbyte **);