---------- Forwarded message ----------
Date: Wed, 19 Apr 2006 17:19:53 -0400 (EDT)
From: Daniel Reed <[EMAIL PROTECTED]>
Reply-To: coder-com@undernet.org
To: Nimrod Gutman <[EMAIL PROTECTED]>
Cc: coder-com@undernet.org
Subject: Re: [Coder-com] Re: [Help] Implementation of the IRC RFC.

On Wed, 19 Apr 2006, Carlos wrote:
Wednesday, April 19, 2006, 8:31:53 PM, you wrote:
NG> I'll show you a simple example. There's a problem with the PART command, the
NG> rfc states that the command should look like:
NG> :[EMAIL PROTECTED] PART #playzone :
NG> And in undernet it got implemented as:
NG> :[EMAIL PROTECTED] PART :#playzone
NG> As you can see there's a problem with the colon there.

The final colon is specified as a "last argument" designator, and is always valid before the final argument. Its presence is optional if there is no ambiguity about which argument is the final one (that is, if the final argument does not contain a space) and that final argument does not itself start with a colon.

The lines
        :[EMAIL PROTECTED] PART #playzone\r\n
and
        :[EMAIL PROTECTED] PART :#playzone\r\n
have identical meaning, and there is no reason to parse them differently. The line
        :[EMAIL PROTECTED] PART #playzone :\r\n
has a third meaning, and the line
        :[EMAIL PROTECTED] PART :#playzone :\r\n
has a fourth meaning. Exploded out, they could be expressed as
 arg0="[EMAIL PROTECTED]", arg1="PART", arg2="#playzone"
 arg0="[EMAIL PROTECTED]", arg1="PART", arg2="#playzone"
 arg0="[EMAIL PROTECTED]", arg1="PART", arg2="#playzone", arg3=""
 arg0="[EMAIL PROTECTED]", arg1="PART", arg2="#playzone :"


NG> Are there any plans on fixing those issues? It can help make konversation work
NG> better under undernet :).

An appropriate fix for Konversation might be to change how arguments are parsed, perhaps using code like:

        argc = 0;
        if (*line == ':')
                line++;
        else
                argv[argc++] = get_my_server_name();

        while ((argc < maxargs) && (tmp = strchr(line, ' ')) != NULL) {
                argv[argc++] = line;
                *tmp = 0;
                line = tmp+1;
                if (*line == ':') {
                        argc++;
                        break;
                }
        }

        argv[argc++] = line;
        argv[argc] = NULL;

--
Daniel Reed <[EMAIL PROTECTED]>   http://shell.n.ml.org/n/        
http://naim.n.ml.org/
If nature has made you a giver, your hands are born open, and so is
your heart. And though there may be times when your hands are empty,
your heart is always full, and you can give things out of that. --
Frances Hodgson Burnett, Novelist
_______________________________________________
Coder-com mailing list
Coder-com@undernet.org
http://undernet.sbg.org/mailman/listinfo/coder-com

Reply via email to