Hi,
On 16 April 2010 22:57, anonymous wrote:
> Update. Renamed one variable (msg to par, cause it is for command
> parameters), rearranged parsein so it don't repeat the same line two
> times.
>
> Is there any maintainer for "sic"? Please review patch, I hope it can
> be applied, it is not for
Update. Renamed one variable (msg to par, cause it is for command
parameters), rearranged parsein so it don't repeat the same line two
times.
Is there any maintainer for "sic"? Please review patch, I hope it can
be applied, it is not for adding features, it just cleans and fixes
the code.
diff -
Patch attached. What I have changed:
* Replaced `tok` and `ctok` functions with `skip` and (already
existing, but a little different) `eat`
* Changed parsing of separators ( from RFC) in server
responses. Now tabs are not skipped. Also no more than one space is
skipped. RFC says there
Another two bugs.
Lines 70-73:
if(!c || !isspace(msg[1]))
sout("%s", msg);
else {
if(msg[1])
If line 73 is executed, isspace(msg[1]) is true. So it can't be equal
to '\0'. Therefore, condition `msg[1]` is always true.
* * *
When you type
:abcd
line 97
sout("%c %s", c, m
On Thu, Apr 15, 2010 at 02:57:59AM +0400, anonymous wrote:
> Also sometimes sic.c uses tok(&s) function instead of ctok(&s, ' ')
> even if RFC says there should be only one space character.
Fix: RFC says there should be only spaces, while tok accepts tabs,
newlines etc.
Here is a patch that use `
I have written the following function:
static char*
skip(char *s, char c) {
while(*s != c && *s != '\0')
s++;
if (*s != '\0')
*s++ = '\0';
return s;
}
Then I can rewrite `ctok` like this:
static char*
ctok(char **s, int c) {
char *p