Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site denelcor.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!hao!denelcor!lmc
From: lmc@denelcor.UUCP (Lyle McElhaney)
Newsgroups: net.bugs.uucp
Subject: FANCYARGS fix.
Message-ID: <360@denelcor.UUCP>
Date: Tue, 20-Mar-84 20:58:35 EST
Article-I.D.: denelcor.360
Posted: Tue Mar 20 20:58:35 1984
Date-Received: Wed, 21-Mar-84 08:41:05 EST
Organization: Denelcor, Aurora, CO
Lines: 39

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