From: "Steve Simon" <steve@quintile.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] pipeto.lib spool and encoding
Date: Thu, 18 Oct 2007 23:22:45 +0100 [thread overview]
Message-ID: <3ea7d3e088d6a82a968ddb56fb9e7591@quintile.net> (raw)
In-Reply-To: <20071018201035.5EC931E8C22@holo.morphisms.net>
> sed '/^$/,$ s/^From / From /' >$TMP.msg
>
> needs to be replaced with a c program that does this
> conversion without coercing its input text into utf-8.
I had one to hand, called /sys/src/cmd/upas/padfrom.c
I think I wrote it, though it may have come from somone
else on the list, if so I appologise.
#include <u.h>
#include <libc.h>
#include <bio.h>
main()
{
char *p;
Biobuf bi, bo;
Binit(&bi, 0, OREAD);
Binit(&bo, 1, OWRITE);
while ((p = Brdline(&bi, '\n')) != nil && Blinelen(&bi) > 1)
Bwrite(&bo, p, Blinelen(&bi));
Bputc(&bo, '\n');
while ((p = Brdline(&bi, '\n')) != nil){
if (strncmp(p, "From ", 5) == 0)
Bputc(&bo, ' ');
Bwrite(&bo, p, Blinelen(&bi));
}
}
next prev parent reply other threads:[~2007-10-18 22:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-16 16:01 Matthias Teege
2007-10-18 20:10 ` Russ Cox
2007-10-18 21:07 ` erik quanstrom
2007-10-19 18:07 ` Russ Cox
2007-10-19 18:22 ` erik quanstrom
2007-10-18 22:22 ` Steve Simon [this message]
2007-10-18 22:34 ` geoff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ea7d3e088d6a82a968ddb56fb9e7591@quintile.net \
--to=steve@quintile.net \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).