comparison src/editfns.c @ 4985:358aa3bb603f

Automatic merge
author Ben Wing <ben@xemacs.org>
date Fri, 05 Feb 2010 12:12:28 -0600
parents 3c3c1d139863
children 1537701f08a1
comparison
equal deleted inserted replaced
4984:f23cd0184dcf 4985:358aa3bb603f
1066 while (1) 1066 while (1)
1067 { 1067 {
1068 Extbyte *buf = alloca_extbytes (size); 1068 Extbyte *buf = alloca_extbytes (size);
1069 Extbyte *formext; 1069 Extbyte *formext;
1070 /* make a copy of the static buffer returned by localtime() */ 1070 /* make a copy of the static buffer returned by localtime() */
1071 struct tm tm = * localtime(&value); 1071 struct tm tm = *localtime (&value);
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, 1077 formext = LISP_STRING_TO_EXTERNAL (format_string,
1078 Qtime_function_encoding); 1078 Qtime_function_encoding);
1079 if (emacs_strftime (buf, size, formext, &tm) 1079 if (emacs_strftime (buf, size, formext, &tm)
1080 || !*buf) 1080 || !*buf)
1081 return build_extstring (buf, Qtime_function_encoding); 1081 return build_extstring (buf, Qtime_function_encoding);
1082 /* If buffer was too small, make it bigger. */ 1082 /* If buffer was too small, make it bigger. */
1083 size *= 2; 1083 size *= 2;
1186 Extbyte tzbuf[100]; 1186 Extbyte tzbuf[100];
1187 Extbyte *tzstring; 1187 Extbyte *tzstring;
1188 Extbyte **oldenv = environ, **newenv; 1188 Extbyte **oldenv = environ, **newenv;
1189 1189
1190 if (STRINGP (zone)) 1190 if (STRINGP (zone))
1191 LISP_STRING_TO_EXTERNAL (zone, tzstring, Qtime_zone_encoding); 1191 tzstring = LISP_STRING_TO_EXTERNAL (zone, Qtime_zone_encoding);
1192 else if (INTP (zone)) 1192 else if (INTP (zone))
1193 { 1193 {
1194 int abszone = abs (XINT (zone)); 1194 int abszone = abs (XINT (zone));
1195 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0), 1195 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0),
1196 abszone / (60*60), (abszone/60) % 60, abszone % 60); 1196 abszone / (60*60), (abszone/60) % 60, abszone % 60);
1432 if (NILP (tz)) 1432 if (NILP (tz))
1433 tzstring = 0; 1433 tzstring = 0;
1434 else 1434 else
1435 { 1435 {
1436 CHECK_STRING (tz); 1436 CHECK_STRING (tz);
1437 LISP_STRING_TO_EXTERNAL (tz, tzstring, Qtime_zone_encoding); 1437 tzstring = LISP_STRING_TO_EXTERNAL (tz, Qtime_zone_encoding);
1438 } 1438 }
1439 1439
1440 set_time_zone_rule (tzstring); 1440 set_time_zone_rule (tzstring);
1441 if (environbuf) 1441 if (environbuf)
1442 xfree (environbuf); 1442 xfree (environbuf);