[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated
From: |
Ken Hornstein |
Subject: |
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 9d83a701e5abb6f9577ab43b6904bd50afa186bc |
Date: |
Sun, 25 Mar 2012 02:32:23 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The nmh Mail Handling System".
The branch, master has been updated
via 9d83a701e5abb6f9577ab43b6904bd50afa186bc (commit)
from 726d5ae2bd65f6936b9291c8dad6c37cb202f482 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=9d83a701e5abb6f9577ab43b6904bd50afa186bc
commit 9d83a701e5abb6f9577ab43b6904bd50afa186bc
Author: Ken Hornstein <address@hidden>
Date: Sat Mar 24 22:32:13 2012 -0400
Add support for %(size).
diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c
index 7abbf43..ff1f66e 100644
--- a/uip/mhlsbr.c
+++ b/uip/mhlsbr.c
@@ -240,6 +240,8 @@ static int issue = 0;
static int exitstat = 0;
static int mhldebug = 0;
+static int filesize = 0;
+
#define PITTY (-1)
#define NOTTY 0
#define ISTTY 1
@@ -848,6 +850,7 @@ process (char *folder, char *fname, int ofilen, int ofilec)
char *cp = NULL;
FILE *fp = NULL;
struct mcomp *c1;
+ struct stat st;
switch (m_setjmp (env)) {
case OK:
@@ -862,6 +865,11 @@ process (char *folder, char *fname, int ofilen, int ofilec)
fname = "(stdin)";
fp = stdin;
}
+ if (fstat(fileno(fp), &st) == 0) {
+ filesize = st.st_size;
+ } else {
+ filesize = 0;
+ }
cp = folder ? concat (folder, ":", fname, NULL) : getcpy (fname);
if (ontty != PITTY)
SIGNAL (SIGINT, intrser);
@@ -1112,7 +1120,7 @@ mcomp_format (struct mcomp *c1, struct mcomp *c2)
c2->c_text = NULL;
dat[0] = 0;
dat[1] = 0;
- dat[2] = 0;
+ dat[2] = filesize;
dat[3] = sizeof(buffer) - 1;
dat[4] = 0;
fmt_compile (c1->c_nfs, &c1->c_fmt);
-----------------------------------------------------------------------
Summary of changes:
uip/mhlsbr.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
hooks/post-receive
--
The nmh Mail Handling System
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 9d83a701e5abb6f9577ab43b6904bd50afa186bc,
Ken Hornstein <=