I've been scripting again, and you know what that means... Bug reports!
Actually, patches in this case...
First: chr.diff
This fixes a buffer smashing problem I ran into with chr(): Currently,
chr() uses word_count() to decide how much to allocate, but then goes on
to use next_arg() to get the arguments (word_count() behavior matches
new_next_arg() behavior, which is different from next_arg().) I also
fixed a redundancy and a minor comment mistake I noticed while trying to
figure out what was going awry in chr().
(Don't ask how I managed to find that bug...)
Next: dcc.c.diff
This is fairly major. Ever since EPIC began URL encoding filenames, the
behavior in the hooks has been a little inconsistent; in most cases,
spaces weren't escaped at all, while additional arguments were passed to
the hook after the filename (making reliable parsing very difficult.)
This patch should¹ make the filenames passed to all of the hooks are URL
encoded, which makes things a lot more consistent on the scripting side.
This patch also fixes some bugs: It fixes DCC REJECT for files that have
been url encoded (previously, the DCC REJECTS were just ignored), it
fixes a bug that prevented downloading on Linux and apparently some
versions of Solaris when DCC_STORE_PATH was unset², and it fixes a very
minor logic error in dcc_send_booster_ctcp().
There are a few inconsistencies remaining, one of which I didn't change
because I wasn't sure of the compatibility implications, and the others
simply because it's late and I'm tired.
1. On DCC_CONNECT gives the filename in the arguments for SENDs but
not GETs. This is a trivial fix and, as far as I can tell, is
simply an oversight.
2. The default 'DCC GET...Completed' message displays the URL
encoded filename, even though the file written to disk has been
decoded. This isn't very consistent and could be confusing,
although probably not to most EPIC users unless they were very
drunk.
3. The filename in the default /dcc connection list is URL
encoded. Same as above.
Anyway, enough spiel... My bed is calling my name.
¹ There's a slight chance I missed a case. The hooks are kind of
scattered throughout the file.
² On BSD, realpath("", buf) returns the CWD; on Linux, realpath("", buf)
returns NULL; on at least some versions of Solaris, realpath("", buf)
causes a segmentation fault. SUSv2 doesn't specify the behavior for
realpath() if the pathname is "", so I went with using "./" if
DCC_STORE_PATH is unset.
--
Ben Winslow <[EMAIL PROTECTED]>
chr.diff.gz
Description: GNU Zip compressed data
dcc.c.diff.gz
Description: GNU Zip compressed data
signature.asc
Description: This is a digitally signed message part
