]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/show.c
show: Drop Windows-specific fmttime2822() code
[empserver] / src / lib / subs / show.c
index f839edc4385712c751cc4b0e2015699baf6af912..79ba622b03bdc9406df746f81938b516b6f0569e 100644 (file)
@@ -31,7 +31,7 @@
  *     Jeff Bailey, 1990
  *     Steve McClure, 1996
  *     Ron Koenderink, 2005-2009
- *     Markus Armbruster, 2006-2020
+ *     Markus Armbruster, 2006-2021
  */
 
 #include <config.h>
@@ -508,7 +508,7 @@ show_product(int tlev)
     int i;
     char *lev;
 
-    pr("product    cost  raw materials  reso dep  level p.e.\n");
+    pr("product    cost  raw materials  avail   reso dep  level p.e.\n");
 
     for (pp = pchr; pp->p_sname; pp++) {
        if (!pp->p_sname[0])
@@ -525,11 +525,12 @@ show_product(int tlev)
            else
                pr("    ");
        }
+       pr(" %8d", pp->p_bwork);
        if (pp->p_nrndx)
-           pr("   %5.5s %3d  ",
+           pr("  %5.5s %3d  ",
               symbol_by_value(pp->p_nrndx, resources), pp->p_nrdep);
        else
-           pr("              ");
+           pr("             ");
        if (pp->p_nlndx < 0)
            pr("1.0\n");
        else {
@@ -614,34 +615,10 @@ static char *
 fmttime2822(time_t t)
 {
     static char buf[32];
-#if defined(_WIN32)
-    size_t n;
-    int nn;
-    TIME_ZONE_INFORMATION tzi;
-    long time_offset;
-    struct tm *time;
-
-    time = localtime(&t);
-
-    n = strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", time);
-    if (CANT_HAPPEN(n == 0)) {
-       buf[0] = 0;
-       return buf;
-    }
-    GetTimeZoneInformation(&tzi);
-    time_offset = -(tzi.Bias +
-       (time->tm_isdst ? tzi.DaylightBias : tzi.StandardBias));
-
-    nn = _snprintf(buf + n, sizeof(buf) - n, " %+03ld%02ld",
-                  time_offset / 60, labs(time_offset) % 60);
-    if (CANT_HAPPEN(nn <= 0 || nn + n >= sizeof(buf)))
-       buf[0] = 0;
-#else
-    size_t n = strftime(buf, sizeof(buf), "%a, %d %b %Y %T %z",
+    size_t n = strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %z",
                        localtime(&t));
     if (CANT_HAPPEN(n == 0))
        buf[0] = 0;
-#endif
     return buf;
 }