diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-08-08 14:03:29 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-08-08 14:03:29 +0200 |
commit | 6229023e78640519c987273558a8649eac1816ca (patch) | |
tree | 3a8b6b95641f635c53e14f8aa94f9a314f77df47 | |
parent | 45176425e3c11657ce3abb02dcc4162e190990b2 (diff) | |
download | mblaze-6229023e78640519c987273558a8649eac1816ca.tar.gz mblaze-6229023e78640519c987273558a8649eac1816ca.tar.xz mblaze-6229023e78640519c987273558a8649eac1816ca.zip |
msed: drop date generation (use mdate)
-rw-r--r-- | msed.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/msed.c b/msed.c index 0817ed9..20a720b 100644 --- a/msed.c +++ b/msed.c @@ -8,7 +8,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <time.h> #include <unistd.h> #include "blaze822.h" @@ -129,7 +128,7 @@ sed(char *file) while (*e && *e != '/') e++; snprintf(headersel, sizeof headersel, - "^(%.*s)*:", e-s, s); + "^(%.*s)*:", (int)(e-s), s); for (s = headersel; *s && *(s+1); s++) if (*s == ':') *s = '|'; @@ -243,7 +242,6 @@ sed(char *file) char *s; char *h = 0; char *v = 0; - char buf[255]; switch (*e) { case 'a': if (he != hs) { @@ -255,16 +253,8 @@ sed(char *file) e++; if (*e == ' ' || *e == '\t' || *e == '\n' || *e == ';' || !*e) { - if (strcasecmp(h, "date") == 0) { - time_t now = time(0); - strftime(buf, sizeof buf, - "%a, %d %b %Y %T %z", - localtime(&now)); - v = buf; - } else { - fprintf(stderr, "no header value for %s\n", h); - exit(1); - } + fprintf(stderr, "no header value for %s\n", h); + exit(1); } else { sep = *e; if (!sep) { |