[net.bugs.uucp] FANCYARGS fix.

lmc@denelcor.UUCP (Lyle McElhaney) (03/21/84)

Sometimes it doesn't pay to get up out of bed.

About a month ago I sent out an error fix for conn.c when compiled with
FANCYARGS defined. I made a small error. Herein is a rerun of the fixes,
correctly this time (I hope).

It seems that when you define FANCYARGS so that you can use the neat stuff
in getargs.c (well, some of us *have* to) then the "" argument used in
L.sys to mean "expect nothing" (or "send nothing") gets broken, because
sendthem and expect in conn.c test for "" explicitly, and not for a zero
length string. The fix is to simply insert a test for zero length of the
input string, and to:

    expect: just return:

	if (strcmp(str, "\"\"") == SAME)
		return(0);
	-----
	if (strlen (str) == 0 || strcmp(str, "\"\"") == SAME)
		return(0);

    sendthem: send a newline, then return:

	/* If "", just send '\r' */
	if (strcmp(str, "\"\"") != SAME)
	-----
	/* If "", just send '\r' */
	if (strlen (str) != 0 && strcmp(str, "\"\"") != SAME)

Formerly, I had checked for a zero length string at the beginning, and then
just returned out of sendthem; however, the proper interpretation of "send
nothing" should be "send a blank line", ie, a newline character, as I would
have known if I had examined the code closer (there's even a comment about
it, fer cats sake!)

Oh, well, better luck next time.
-- 
		Lyle McElhaney
		(hao,brl-bmd,nbires,csu-cs,scgvaxd)!denelcor!lmc