From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: David Presotto To: 9fans@cse.psu.edu Subject: Re: [9fans] nedmail.c In-Reply-To: <1450f0a4c5f10e8a355290f54d4f148d@sdgm.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-ebdmmkbestjbmtlbejqcvhtybe" Date: Mon, 4 Aug 2003 20:01:49 -0400 Topicbox-Message-UUID: 11f0982c-eacc-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-ebdmmkbestjbmtlbejqcvhtybe Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit ARRGGGHHHHH! I hate the friggin update command. I've updated twice now and the local copy still hasn't made it out. I'll just to a cp. --upas-ebdmmkbestjbmtlbejqcvhtybe Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Mon Aug 4 17:08:27 EDT 2003 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Mon Aug 4 17:08:24 EDT 2003 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 8CD4D19BF2; Mon, 4 Aug 2003 17:08:11 -0400 (EDT) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 65BEA19BC4; Mon, 4 Aug 2003 17:08:07 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 2AB5119BF0; Mon, 4 Aug 2003 17:07:17 -0400 (EDT) Received: from brahma.sdgm.net (brahma.sdgm.net [64.32.179.49]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 4819B19BC4 for <9fans@cse.psu.edu>; Mon, 4 Aug 2003 17:07:16 -0400 (EDT) Message-ID: <1450f0a4c5f10e8a355290f54d4f148d@sdgm.net> From: boyd@sdgm.net To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] nedmail.c Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Mon, 4 Aug 2003 17:07:15 -0400 X-Spam-Status: No, hits=0.6 required=5.0 tests=NO_REAL_NAME,PATCH_CONTEXT_DIFF version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) doesn't look right to me: brahma% 9fs sources !Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1 user[boyd]: password: ! brahma% ls -l /n/sources/plan9/sys/src/cmd/upas/ned/nedmail.c --rw-rw-r-- M 2478 glenda sys 42722 Jun 15 14:52 /n/sources/plan9/sys/src/cmd/upas/ned/nedmail.c brahma% ape/diff -c /n/sources/plan9/sys/src/cmd/upas/ned/nedmail.c src/upas/ned *** /n/sources/plan9/sys/src/cmd/upas/ned/nedmail.c Sun Jun 15 14:52:38 2003 --- src/upas/ned/nedmail.c Mon Jul 28 20:05:26 2003 *************** *** 123,129 **** { "u", 0, ucmd, "u remove deletion mark" }, { "w", 1, wcmd, "w file store message contents as file" }, { "x", 0, xcmd, "x exit without flushing deleted messages" }, ! { "y", 0, ycmd, "x synchronize with mail box" }, { "=", 1, eqcmd, "= print current message number" }, { "|", 1, pipecmd, "|cmd pipe message body to a command" }, { "||", 1, rpipecmd, "|cmd pipe raw message to a command" }, --- 123,129 ---- { "u", 0, ucmd, "u remove deletion mark" }, { "w", 1, wcmd, "w file store message contents as file" }, { "x", 0, xcmd, "x exit without flushing deleted messages" }, ! { "y", 0, ycmd, "y synchronize with mail box" }, { "=", 1, eqcmd, "= print current message number" }, { "|", 1, pipecmd, "|cmd pipe message body to a command" }, { "||", 1, rpipecmd, "|cmd pipe raw message to a command" }, *************** *** 191,196 **** --- 191,205 ---- noted(NDFLT); } + char * + plural(int n) + { + if (n == 1) + return ""; + + return "s"; + } + void main(int argc, char **argv) { *************** *** 270,276 **** n = dir2message(&top, reverse); if(n < 0) sysfatal("can't read %s", s_to_c(top.path)); ! Bprint(&out, "%d messages\n", n); } notify(catchnote); --- 279,285 ---- n = dir2message(&top, reverse); if(n < 0) sysfatal("can't read %s", s_to_c(top.path)); ! Bprint(&out, "%d message%s\n", n, plural(n)); } notify(catchnote); *************** *** 1152,1158 **** i = 0; for(; m != nil; m = m->next) i++; ! Bprint(&out, "%d messages\n", i); } Message* --- 1161,1167 ---- i = 0; for(; m != nil; m = m->next) i++; ! Bprint(&out, "%d message%s\n", i, plural(i)); } Message* *************** *** 1488,1494 **** Bprint(&out, "!1 message deleted\n"); break; default: ! Bprint(&out, "!%d messages deleted\n", deld); break; } --- 1497,1503 ---- Bprint(&out, "!1 message deleted\n"); break; default: ! Bprint(&out, "!%d message%s deleted\n", deld, plural(deld)); break; } *************** *** 1569,1575 **** n = dir2message(&top, reverse); if(n > 0) ! Bprint(&out, "%d new messages\n", n); return m; } --- 1578,1584 ---- n = dir2message(&top, reverse); if(n > 0) ! Bprint(&out, "%d new message%s\n", n, plural(n)); return m; } --upas-ebdmmkbestjbmtlbejqcvhtybe--